Hi,
Just a pre-re-invent-the-wheel inquiry... Does anyone have an example of macros
for formatting form fields in phptal?
I have an older framework which create field objects based on the data and
type, and populates them from a simple array:
e.g.
array('label'=>'', 'type'=>'hidden', 'v
On 02.08.2010, at 19:27, Richard Dyce wrote:
>
> Just a pre-re-invent-the-wheel inquiry... Does anyone have an example of
> macros for formatting form fields in phptal?
>
> I have an older framework which create field objects based on the data and
> type, and populates them from a simple array:
Hi,
Speaking in terms of MVC your $fields array is a "model" of a form. It is
indeed a model that relatively closely describes, what you want to output in
html, but nevertheless it is a model.
So what you want to do is to iterate over this model and render it:
:-) I take your point...
Yes, I do have a framework - but it's not the framework I'm currently using!
On 2 Aug 2010, at 20:17, Kornel Lesiński wrote:
> On 02.08.2010, at 19:27, Richard Dyce wrote:
>>
>> Just a pre-re-invent-the-wheel inquiry... Does anyone have an example of
>> macros for form
Per,
That's a great help.
Yes, the model is massively simplified, but I figured it was better to explain
what I was getting at... I take your point about ugliness!
On 2 Aug 2010, at 20:20, Per Bernhardt wrote:
> So keep improving your model! By the way: You should always prefer strong
> class
The simple advantage of objects is, that they are not only data but also logic
that can operate on this data.
In our example this logic could simply be to check, if an option is selected.
Although this example is very simple, comparing to values on their equalance is
logic.
Imagine you would have