This is what components are for.
Here's an example from jobeet:
http://www.symfony-project.org/jobeet/1_4/Doctrine/en/19#chapter_19_language_switching

On Fri, Jan 7, 2011 at 07:33, Eric B <[email protected]> wrote:
> Hi,
>
> This may sound like a newbie question, but I just can't figure out the
> "right" way of doing this.
>
> I'm looking to put a simple login form in my layout template to appear in
> all pages.  Since I don't have an action associated with the template
> itself, I'm not sure how to instantiate my LoginForm.  I tried within the
> template itself, but I get an error message (rightly so) indicating that the
> class cannot be found.  So I can either manually include the Form class and
> all the hierarchy (which sounds like an incredibly difficult task), or
> figure out another way.
>
> So far, I've come up with the two following:
> 1) Create a filter and instantiate the login form in the filter and insert
> it into the request object.  Then in the template get the form from the
> request object.
> 2) Manually create <input>s in the template without actually using my sfForm
> LoginForm.
>
> Problems with these 2 hacks:
> 1) Very ugly.  Can't imagine that there isn't a better idea/solution.  It
> just doesn't seem like the right use of the filter.
> 2) Am missing the CSRF field.  So I can either disable the CSRF field from
> my action, or manually create that field too.  Also seems ugly.
>
> I'm sure there must be another solution out there that I can't figure out.
>
> Can anyone point me in the right direction please?
>
> Thanks!
>
> Eric
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to