本文整理汇总了PHP中ActionController::init方法的典型用法代码示例。如果您正苦于以下问题:PHP ActionController::init方法的具体用法?PHP ActionController::init怎么用?PHP ActionController::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionController
的用法示例。
在下文中一共展示了ActionController::init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
$tabs = $this->getTabs();
$type = $this->getType();
if (in_array(ucfirst($type), $this->globalTypes)) {
$ltype = strtolower($type);
$tabs->add('overview', array('url' => 'director', 'label' => $this->translate('Overview')));
foreach ($this->globalTypes as $tabType) {
$ltabType = strtolower($tabType);
$tabs->add($ltabType, array('label' => $this->translate(ucfirst($ltabType) . 's'), 'url' => sprintf('director/%ss', $ltabType)));
}
$tabs->activate($ltype);
return;
}
$object = $this->dummyObject();
if ($object->isGroup()) {
$type = substr($type, 0, -5);
}
$tabs = $this->getTabs()->add('objects', array('url' => sprintf('director/%ss', strtolower($type)), 'label' => $this->translate(ucfirst($type) . 's')));
if ($object->supportsGroups() || $object->isGroup()) {
$tabs->add('objectgroups', array('url' => sprintf('director/%sgroups', $type), 'label' => $this->translate('Groups')));
}
$tabs->add('tree', array('url' => sprintf('director/%ss/templatetree', $type), 'label' => $this->translate('Tree')));
}
示例2: init
/**
* Initialize the controller and collect all tabs for it from the application and its modules
*
* @see ActionController::init()
*/
public function init()
{
parent::init();
$this->view->tabs = ControllerTabCollector::collectControllerTabs('PreferenceController');
}
示例3: init
/**
* Init function.
* Only administrators have access to the module.
*/
public function init()
{
parent::init();
$this->accessGranted(User::ROLE_ADMIN);
}