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