本文整理汇总了PHP中Cake\View\View::helpers方法的典型用法代码示例。如果您正苦于以下问题:PHP View::helpers方法的具体用法?PHP View::helpers怎么用?PHP View::helpers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\View\View
的用法示例。
在下文中一共展示了View::helpers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: baseHelpers
/**
* Load base helpers.
*
* @param View $view
*/
public static function baseHelpers(View $view)
{
$view->loadHelper('Html', ['className' => 'Union/Core.Html']);
$view->loadHelper('Union/Core.Document');
$view->loadHelper('Url', ['className' => 'Union/Core.Url']);
$view->loadHelper('Form', ['className' => 'Union/Core.Form', 'widgets' => ['_default' => ['Union\\Core\\View\\Widget\\BasicWidget']]]);
$view->loadHelper('Paginator', ['templates' => 'Union/Core.paginate_tpl']);
$view->loadHelper('Union/Core.Less');
$view->loadHelper('Union/Core.Union');
$view->loadHelper('Union/Core.Assets');
$view->loadHelper('Union/Core.ToolBar');
$view->loadHelper('Union/Core.XmlForm');
if ($view->request->param('prefix') == 'admin') {
$view->loadHelper('Union/Core.Ace');
$view->loadHelper('Union/Core.Admin');
$view->helpers()->get('Paginator')->config(['templates' => 'Union/Core.paginate_tpl_admin']);
}
}
示例2: __construct
/**
* Default Constructor
*
* @param \Cake\View\View $View The View this helper is being attached to.
* @param array $config Configuration settings for the helper.
*/
public function __construct(View $View, array $config = [])
{
$this->_View = $View;
$this->request = $View->request;
$this->config($config);
if (!empty($this->helpers)) {
$this->_helperMap = $View->helpers()->normalizeArray($this->helpers);
}
$this->initialize($config);
}