View helpers typo

2 messages Options
Embed this post
Permalink
Guillaume Rossolini

View helpers typo

Reply Threaded More More options
Print post
Permalink
Hi,

I think there is a slight typo here:
http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.paths

<?php
$view = new Zend_View();
// Add /path/to/some/helpers with class prefix 'My_View_Helper'
$view->addHelperPath('/path/to/some/helpers', 'My_View_Helper');
// Add /other/path/to/helpers with class prefix 'Your_View_Helper'
$view->addHelperPath('/other/path/to/helpers', 'Your_View_Helper');

// now when you call $this->helperName(), Zend_View will look first for
// "/other/path/to/helpers/HelperName.php" using class name "My_View_Helper_HelperName",
// then for "/path/to/some/helpers/HelperName" using class name "Your_View_Helper_HelperName",
// and finally for "Zend/View/Helper/HelperName.php" using class name "Zend_View_Helper_HelperName".


I am confused: is it a LIFO or a FIFO?

Regards,

Guillaume Rossolini
weierophinney

Re: View helpers typo

Reply Threaded More More options
Print post
Permalink
-- Guillaume Rossolini <[hidden email]> wrote
(on Monday, 07 July 2008, 03:45 PM +0200):

> I think there is a slight typo here:
> http://framework.zend.com/manual/en/zend.view.helpers.html#
> zend.view.helpers.paths
>
> <?php
> $view = new Zend_View();
> // Add /path/to/some/helpers with class prefix 'My_View_Helper'
> $view->addHelperPath('/path/to/some/helpers', 'My_View_Helper');
> // Add /other/path/to/helpers with class prefix 'Your_View_Helper'
> $view->addHelperPath('/other/path/to/helpers', 'Your_View_Helper');
>
> // now when you call $this->helperName(), Zend_View will look first for
> // "/other/path/to/helpers/
> HelperName.php" using class name "My_View_Helper_HelperName",
> // then for "/path/to/some/helpers/
> HelperName" using class name "Your_View_Helper_HelperName",
> // and finally for "Zend/View/Helper/
> HelperName.php" using class name "Zend_View_Helper_HelperName".
>
>
> I am confused: is it a LIFO or a FIFO?

LIFO.

And yes, there is a typo there -- it would look for
Your_View_Helper_HelperName before looking for
My_View_Helper_HelperName; I've corrected it in trunk, though the fix
will not show until the next release.

--
Matthew Weier O'Phinney
Software Architect       | [hidden email]
Zend Framework           | http://framework.zend.com/