本文整理汇总了PHP中Cake\View\View::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP View::initialize方法的具体用法?PHP View::initialize怎么用?PHP View::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\View\View
的用法示例。
在下文中一共展示了View::initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* Initialization hook method.
*
* For e.g. use this method to load a helper for all views:
* `$this->loadHelper('Html');`
*
* @return void
*/
public function initialize()
{
parent::initialize();
if (Configure::read('Facebook.app_id')) {
$this->loadHelper('JorgeFacebook.Facebook');
}
}
示例2: initialize
/**
* Initialization hook method.
*
* For e.g. use this method to load a helper for all views:
* `$this->loadHelper('Html');`
*
* @return void
*/
public function initialize()
{
parent::initialize();
if ($this->request->action === 'add') {
//$this->loadHelper('Tag.TagCloud');
}
}
示例3: initialize
/**
* Initialization hook method.
*
* For e.g. use this method to load a helper for all views:
* `$this->loadHelper('Html');`
*
* @return void
*/
public function initialize()
{
parent::initialize();
$this->loadHelper('Html');
$this->loadHelper('Form');
$this->loadHelper('MyUtils');
}
示例4: initialize
/**
* Initialization hook method.
*
* For e.g. use this method to load a helper for all views:
* `$this->loadHelper('Html');`
*
* @return void
*/
public function initialize()
{
parent::initialize();
// $this->loadHelper('Html');
// $this->loadHelper('Form');
// $this->loadHelper('Flash');
}
示例5: initialize
/**
* Initialization hook method.
*
* Properties like $helpers etc. cannot be initialized statically in your custom
* view class as they are overwritten by values from controller in constructor.
* So this method allows you to manipulate them as required after view instance
* is constructed.
*
* @return void
*/
public function initialize()
{
parent::initialize();
$this->_setupPaths();
$this->_setupHelpers();
$this->_loadAssets();
}
示例6: initialize
/**
* Initialization hook method.
*
* For e.g. use this method to load a helper for all views:
* `$this->loadHelper('Html');`
*
* @return void
*/
public function initialize()
{
parent::initialize();
$this->loadHelper('Flash');
$this->loadHelper('Number');
$this->loadHelper('Text');
$this->loadHelper('Time');
}
示例7: initialize
public function initialize()
{
parent::initialize();
$this->loadHelper('Admin.Menu');
if ($this->request->action === 'edit' || $this->request->action === 'add') {
$this->loadHelper('Form', ['templates' => 'Admin.app_form']);
}
}
示例8: initialize
/**
* Initialization hook method.
*
* Use this method to add common initialization code like loading helpers.
*
* e.g. `$this->loadHelper('Html');`
*
* @return void
*/
public function initialize()
{
parent::initialize();
$this->loadHelper('Html');
$this->loadHelper('Form');
$this->loadHelper('Paginator');
$this->loadHelper('Url');
$this->loadHelper('Flash');
}
示例9: initialize
/**
* Initialization hook method.
*
* For e.g. use this method to load a helper for all views:
* `$this->loadHelper('Html');`
*
* @return void
*/
public function initialize()
{
parent::initialize();
// $this->loadHelper('Html', ['className' => 'BootstrapUI.Html']);
// $this->loadHelper('Form', ['className' => 'BootstrapUI.Form']);
// $this->loadHelper('Flash', ['className' => 'BootstrapUI.Flash']);
// $this->loadHelper('Paginator', ['className' => 'BootstrapUI.Paginator']);
$this->eventManager()->dispatch(new Event('Spider.SpiderAppView.initialize', $this));
}
示例10: initialize
/**
* Initialization hook method.
*
* For e.g. use this method to load a helper for all views:
* `$this->loadHelper('Html');`
*
* @return void
*/
public function initialize()
{
parent::initialize();
$this->loadHelper('Bool');
$this->loadHelper('Pretty');
$this->loadHelper('Html', ['className' => 'BootstrapUI.Html']);
$this->loadHelper('Form', ['className' => 'BootstrapUI.Form']);
$this->loadHelper('Flash', ['className' => 'BootstrapUI.Flash']);
$this->loadHelper('Paginator', ['className' => 'BootstrapUI.Paginator']);
}
示例11: initialize
/**
* Initialization hook method.
*
* For e.g. use this method to load a helper for all views:
* `$this->loadHelper('Html');`
*
* @return void
*/
public function initialize()
{
parent::initialize();
$this->loadHelper('Html', ['className' => 'BootstrapUI.Html']);
$this->loadHelper('Form', ['className' => 'BootstrapUI.Form']);
$this->loadHelper('Flash', ['className' => 'BootstrapUI.Flash']);
$this->loadHelper('Paginator', ['className' => 'BootstrapUI.Paginator']);
$this->Html->addCrumb('Home', '/');
$this->Html->addCrumb($this->request->params['controller'], ['controller' => $this->request->params['controller'], 'action' => 'index']);
}
示例12: initialize
public function initialize()
{
parent::initialize();
$this->loadHelper('Core');
if ($this->request->params['plugin'] == 'Admin') {
$this->loadHelper('Form', ['templates' => 'Admin.app_form', 'errorClass' => 'state-error']);
} elseif (!isset($this->request->params['plugin'])) {
$this->loadHelper('Form', ['templates' => 'app_form']);
}
}
示例13: initialize
public function initialize()
{
parent::initialize();
$this->loadHelper('Html');
$this->loadHelper('Form');
$this->loadHelper('Url');
$this->loadHelper('Theme');
$this->loadHelper('Paginator');
$this->Paginator->templates(['number' => '<li class="pagination-item"><a href="{{url}}">{{text}}</a></li>', 'current' => '<li class="pagination-item active"><a href="{{url}}">{{text}}</a></li>']);
}
示例14: initialize
/**
* Initialization hook method.
*
* For e.g. use this method to load a helper for all views:
* `$this->loadHelper('Html');`
*
* @return void
*/
public function initialize()
{
parent::initialize();
$this->loadHelper('AppUi.AppUi');
$this->loadHelper('Form', ['templates' => 'AppUi.theme_form']);
$this->loadHelper('Social.Activity');
$this->loadHelper('Social.Likeable');
$this->loadHelper('Social.Followable');
$this->loadHelper('Social.Commentable');
$this->loadHelper('Text');
}
示例15: initialize
/**
* Initialization hook method.
*
* Use this method to add common initialization code like loading helpers.
*
* e.g. `$this->loadHelper('Html');`
*
* @return void
*/
public function initialize()
{
parent::initialize();
$this->loadHelper('Html', ['className' => 'AppHtml', 'App' => \Cake\Core\Configure::read('App')]);
$this->loadHelper('Form', ['className' => 'Form', 'templates' => ['select' => '<select name="{{name}}"{{attrs}} class="form-control">{{content}}</select>', 'dateWidget' => '<ul class="list-inline"><li class="year">{{year}}</li><li class="month">{{month}}</li><li class="day">{{day}}</li></ul>', 'help' => '<p class="help-block"><i class="fa fa-info-circle"></i> {{content}}</p>']]);
$this->loadHelper('Flash', ['className' => 'BootstrapUI.Flash', 'element' => 'Flash/default']);
// $this->loadHelper('Paginator', ['className' => 'BootstrapUI.Paginator']);
$this->loadHelper('Gravatar.Gravatar');
$this->loadHelper('Tanuck/Markdown.Markdown', ['parser' => 'GithubMarkdown']);
$this->Paginator->templates(['sort' => '<a href="{{url}}" class="{{class}}"><span class="fa fa-fw fa-sort"></span> {{text}}</a>', 'sortAsc' => '<a href="{{url}}" class="{{class}}"><span class="fa fa-fw fa-sort-amount-desc"></span> {{text}}</a>', 'sortDesc' => '<a href="{{url}}" class="{{class}}"><span class="fa fa-fw fa-sort-amount-asc"></span> {{text}}</a>', 'sortAscLocked' => '<a href="{{url}}" class="{{class}}"><span class="fa fa-fw fa-sort-amount-asc"></span> {{text}}</a>', 'sortDescLocked' => '<a href="{{url}}" class="{{class}}"><span class="fa fa-fw fa-sort-amount-desc"></span> {{text}}</a>']);
}