[Solar-talk] Forms, User roles and access
Tino Ehrich
ehrich at efides.com
Mon Mar 24 13:00:25 CDT 2008
I also thought more about the mentioned "view" aspect.
Sometime ago I wrote an own form class called esiform.
The definition of the form and the design customization
is handled by two steps. First the definition of the form fields
and secondly the form template with placeholders for the
form fields, its descriptions, error/validation messages etc.
The field definition is handled as by Solar_Form.
The design template looks like the following simple example:
{email:label}<br />
{email:field}
{email:error}
Each placeholder will be automatically replaced by the form definitions.
{email:error} can be customzied and will be replaced by nothing as long
as no errors occured.
Surely, when it comes to the design customization one has to write more.
But the benefits are obvious.
Is it possible to realize this with Solar_Form respectively to implement it?
Where can I see the other example from Darwin Cruz?
Cheers
Tino
Kilbride, James P. wrote:
>
> It depends. Solar_Form outputs a default view based on the order the
> elements were added. If you want more control you pull the elements from
> the form and embed them into the view. Darwin Cruz has a good example of
> how to do that. But you lose some of the automatic generation of error
> messages, validation output, and some other nifty things. And it's more
> than one line of code while the default form output is a single line.
> Depends what you want.
>
> James Kilbride
>
> -----Original Message-----
> From: solar-talk-bounces at lists.solarphp.com
> [mailto:solar-talk-bounces at lists.solarphp.com] On Behalf Of Robert
> Gonzalez
> Sent: Monday, March 24, 2008 12:44 PM
> To: solar-talk at lists.solarphp.com
> Subject: Re: [Solar-talk] Forms, User roles and access
>
> Wouldn't the way the form renders be a decision of the view? I only ask
> that because if your application changed views later, and in that view
> elements of the form (say buttons, grouped three across) were to be
> rendered vertically instead of horizontally, you would have to change
> application code to render the way you want.
>
> If the elements of the form are known to the view then the view can
> place things where they are supposed to go without futzing with the
> controller code or with the form object itself, instead taking the items
> the form object gives it and putting those items wherever necessary for
> rendering accoring to that view.
>
> Does that make sense or am I just making noise (seriously, because
> sometimes I just don't know about myself).
>
>
>> Solar_Form:
>> How can I customize the way the form is build up
>> concerning the design? E.g.: I would like to set some
>> fields next to each other instead of below.
>>
>> Tino
>
> --
> Robert A. Gonzalez
>
> _______________________________________________
> Solar-talk mailing list
> Solar-talk at lists.solarphp.com
> http://mailman-mail3.webfaction.com/listinfo/solar-talk
>
> _______________________________________________
> Solar-talk mailing list
> Solar-talk at lists.solarphp.com
> http://mailman-mail3.webfaction.com/listinfo/solar-talk
>
>
--
View this message in context: http://www.nabble.com/Forms%2C-User-roles-and-access-tp16254963p16257368.html
Sent from the SolarPHP Talk mailing list archive at Nabble.com.
More information about the Solar-talk
mailing list