本文整理汇总了PHP中CommonController::init方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonController::init方法的具体用法?PHP CommonController::init怎么用?PHP CommonController::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonController
的用法示例。
在下文中一共展示了CommonController::init方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* {@inheritDoc}
*/
protected function init()
{
if ($languages = $this->_getCache(0, MODULE_NAME . DS . LANG . DS . 'comments', false, LANG_PATH)) {
L($languages);
}
parent::init();
}
示例2: init
protected function init()
{
parent::init();
$this->_cursorPath = "House_Updown_HouseLogFixedV2";
$options = $this->getOptions();
if (isset($options['city'])) {
$this->_city = explode(',', $options['city']);
$this->_cursorPath .= "-" . $options['city'];
}
if (isset($options['mod'])) {
$this->_mod = explode(',', $options['mod']);
$this->_cursorPath .= "-" . $options['mod'];
}
}
示例3: init
public function init()
{
parent::init();
$currentRequest = '/' . strtolower(implode('/', [$this->_request->module, $this->_request->controller, $this->_request->action]));
$this->getView()->currentRequest = $currentRequest;
if ($this->checkAuthorization && $this->userInfo) {
$rbacManage = \Core\ServiceLocator::getInstance()->get('rbacManage');
if (!$rbacManage->isAdmin($this->userInfo['name'])) {
$authInfo = $rbacManage->checkAuthorization($this->userInfo['id'], $currentRequest);
if ($authInfo == false) {
throw new \Exception('没有节点访问权限');
}
}
}
}
示例4: init
protected function init()
{
parent::init();
if (!file_exists($this->_cursorFile)) {
if (false === file_put_contents($this->_cursorFile, 0)) {
$this->logMsg(sprintf('写入游标失败。请检查目录的权限。游标文件:%s', $this->_cursorFile));
exit;
}
return;
}
if (!is_readable($this->_cursorFile)) {
$this->logMsg(sprintf('游标文件:%s 不可读,请检查文件权限。', $this->_cursorFile));
exit;
}
if (!is_writable($this->_cursorFile)) {
$this->logMsg(sprintf('游标文件:%s 不可写,请检查文件权限。', $this->_cursorFile));
exit;
}
file_put_contents($this->_doneFile, '');
$this->_startId = intval(file_get_contents($this->_cursorFile));
}
示例5: init
function init()
{
parent::init();
$app = Yii::app();
$app->sourceLanguage = 'xx';
if (isset($_POST['_lang'])) {
$app->language = $_POST['_lang'];
$app->session['_lang'] = $app->language;
}
if (isset($_GET['_lang'])) {
$app->language = $_GET['_lang'];
$app->session['_lang'] = $app->language;
} else {
if (isset($app->session['_lang'])) {
$app->language = $app->session['_lang'];
} else {
$app->language = 'es_mx';
// default to spanish / mexico
}
}
}
示例6: init
/**
* {@inheritDoc}
*/
protected function init()
{
require CORE_PATH . 'functions/dir.php';
parent::init();
}
示例7: init
public function init()
{
parent::init();
$this->auth = new Service\user\DbUserAuth();
}