To use a helper in your view script, call it using $this->helperName(). Behind the scenes, Zend_View will load the Zend_View_Helper_HelperName class, create an object instance of it, and call its helperName() method. The object instance is persistent within the Zend_View instance, and is reused for all future calls to $this->helperName().
public function __call($name, $args)
{
// is the helper already loaded?
$helper = $this->getHelper($name);
// call the helper method
return call_user_func_array(
array($helper, $name),
$args
);
}From above code snippets, we know that view uses plugin loader to load helper by name, then call the helper's method.
本文详细介绍了如何在视图脚本中调用助手法,通过内部加载类实例并调用方法,实现代码复用和提高开发效率。了解如何在视图中使用插件加载器来加载和调用助手法。
702

被折叠的 条评论
为什么被折叠?



