On Tue, 24 Feb 2009, SeeVik wrote:
> Hmmm....that is exactly what I wanted to avoid - writing the
> use_helper again and again.
Again, this is ALL documented in the book:
"You cannot remove the first four helper groups in the preceding list
(Helper, Tag, Url, and Asset), because they are compulsory for the
templating engine to work properly. Consequently, they don't even appear
in the list of standard helpers."
"If you ever need to use a helper outside a template, you can still load a
helper group from anywhere by calling
sfProjectConfiguration::getActive()->loadHelpers($helpers), where $helpers
is a helper group name or an array of helper group names. For instance, if
you want to use auto_link_text() in an action, you need to call
sfProjectConfiguration::getActive()->loadHelpers('Text') first."
http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer#chapter_07_sub_helpers
If you know all the templates of a particular module need a helper that
you need to always load, you could create a preExecute() function in your
actions class to load them every time.
http://www.symfony-project.org/book/1_2/06-Inside-the-Controller-Layer#chapter_06_sub_repeating_code_for_several_actions_of_a_module
--
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---