16Mar/102
Using helpers within an action in symfony
If you ever need to use a helper outside a template, you can still load a helper group from anywhere by calling
sfLoader::loadHelpers($helpers)
where $helpers is a helper group name or an array of helper group names.
For instance, if you want to use simple_format_text() in an action, you need to call
sfLoader::loadHelpers('Text');
first.
I know this is covered in the symfony docs but it's a fairly handy thing to know so thought I would make it easier to find.
March 18th, 2010 - 22:25
sfLoader is deprecated > 1.2
Use:
sfProjectConfiguration::getActive()->loadHelpers(array(“Text”));
March 19th, 2010 - 04:17
Yeah that’s true. Maybe I need to make It clearer this is 1.0 related.
Cheers for commenting.