本文整理匯總了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);
}