2009年11月26日星期四

[fw-mvc] access url view helper from my custom view helper

Hi I have got a simple view helper which is sitting inside views/helpers
directory that generates a list of links

class Zend_View_Helper_Catmenu
{
public function Catmenu($cats)
{
$catMenu='';

foreach ($cats as $cat)
{
$catMenu .= "<li> \"<b /cats/index/cat/$cat[cat_url]\">$cat[cat] </li>";
}

return $catMenu;
}

}


I would like to use the url helper which is in this case "echo
$this->url(array('controller'=>'cats', 'action'=>'index',
'cat'=>$cat[cat_url]));" for the highlighted code above. As I am not in the
view i won't be able to access the url helper.

Any other way to access a helper inside my custom helper, like in this
example
--
View this message in context: http://n4.nabble.com/access-url-view-helper-from-my-custom-view-helper-tp788528p788528.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: