Access the non-direct View Helper methods in Zend Framework
Something that was temporarily puzzling me so I thought I would post about it. As in most examples to access the direct() method of a View Helper, you simply call the class name on the View Object:
$view->baseUrl();
But if you want to access any of the methods other than direct() you’ve got to get the Helper first, as unlike most Action Helpers they don’t implement a fluent interface because they return bits of the view instead (usually HTML)
$this->getHelper('BaseUrl')->setBaseUrl();
1 Comment
Leave a comment
Categories
- Been knackered for days on end, long day with relatives today then most of tomorrow in the office doing downtime maintenance. I should rest!
- Dinner with my mom, couz and uncle (@ Gold Mine) http://t.co/pj4iA2Ul
- Om nom nom http://t.co/Kd2CIzs9
- I'm at Westfield London Shopping Centre (Shepherd's Bush, Greater London) w/ 13 others http://t.co/b2kCzQOG
- Off to see relatives (@ Northampton Railway Station (NMP) w/ 2 others) http://t.co/3ekCATN8
Recent Posts
- Use Zend_Log_Writer_Firebug to debug AJAX requests using Firebug
- Using Zend_Db_Profiler_Firebug to show database queries per page
- Checking $mixed parameter type for PHP methods
- “concrete5 cannot parse the PATH_INFO or ORIG_PATH_INFO information provided by your server.”
- Enable hibernation on HP MicroServer for Windows Home Server v1





Thanks very much. This information was very helpful and was not available as commonly as one would have thought. Appreciate your gesture in making it available to all. Rgds, Vijay