本文整理汇总了PHP中Zend_View_Helper_Navigation_HelperAbstract::__call方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View_Helper_Navigation_HelperAbstract::__call方法的具体用法?PHP Zend_View_Helper_Navigation_HelperAbstract::__call怎么用?PHP Zend_View_Helper_Navigation_HelperAbstract::__call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View_Helper_Navigation_HelperAbstract
的用法示例。
在下文中一共展示了Zend_View_Helper_Navigation_HelperAbstract::__call方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __call
/**
* Magic overload: Proxy to other navigation helpers or the container
*
* Examples of usage from a view script or layout:
* <code>
* // proxy to Menu helper and render container:
* echo $this->navigation()->menu();
*
* // proxy to Breadcrumbs helper and set indentation:
* $this->navigation()->breadcrumbs()->setIndent(8);
*
* // proxy to container and find all pages with 'blog' route:
* $blogPages = $this->navigation()->findAllByRoute('blog');
* </code>
*
* @param string $method helper name or method name in
* container
* @param array $arguments [optional] arguments to pass
* @return mixed returns what the proxied call returns
* @throws Zend_View_Exception if proxying to a helper, and the
* helper is not an instance of the
* interface specified in
* {@link findHelper()}
* @throws Zend_Navigation_Exception if method does not exist in container
*/
public function __call($method, array $arguments = array())
{
// check if call should proxy to another helper
if ($helper = $this->findHelper($method, false)) {
return call_user_func_array(array($helper, $method), $arguments);
}
// default behaviour: proxy call to container
return parent::__call($method, $arguments);
}
示例2: __call
/**
* Magic overload: Proxy calls to {@link findRelation()} or container
*
* Examples of finder calls:
* <code>
* // METHOD // SAME AS
* $h->findRelNext($page); // $h->findRelation($page, 'rel', 'next')
* $h->findRevSection($page); // $h->findRelation($page, 'rev', 'section');
* $h->findRelFoo($page); // $h->findRelation($page, 'rel', 'foo');
* </code>
*
* @param string $method method name
* @param array $arguments method arguments
* @throws Zend_Navigation_Exception if method does not exist in container
*/
public function __call($method, array $arguments = array())
{
if (@preg_match('/find(Rel|Rev)(.+)/', $method, $match)) {
return $this->findRelation($arguments[0],
strtolower($match[1]),
strtolower($match[2]));
}
return parent::__call($method, $arguments);
}