本文整理汇总了PHP中AppController::init方法的典型用法代码示例。如果您正苦于以下问题:PHP AppController::init方法的具体用法?PHP AppController::init怎么用?PHP AppController::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppController
的用法示例。
在下文中一共展示了AppController::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modify
function modify()
{
global $lll, $siteDemo, $allowedMethods;
$found = FALSE;
if ($siteDemo || !class_exists('rss')) {
// It is disabled to save these attributes in the demo version:
foreach (array("extraHead", "extraBody", "extraTopContent", "extraBottomContent", "extraFooter", "logoImage", "headerBackground") as $attr) {
if (!empty($this->{$attr})) {
$found = TRUE;
$this->{$attr} = "";
}
}
}
foreach (array("homeLocation", "redirectFirstLogin", "redirectLogin", "redirectAdminLogin") as $attr) {
$ctrl = new AppController();
if ($this->{$attr}) {
if (!$ctrl->init($this->{$attr}) || !isset($allowedMethods[$ctrl->method]) || !class_exists($ctrl->getClass())) {
return Roll::setFormInvalid("invalidInternalLink", $this->{$attr});
}
}
}
modify($this);
$this->uploadImages();
if ($found) {
Roll::setInfoText("This feature is not available in the Lite (and demo) version of the program!");
}
}
示例2: init
function init($ctx)
{
parent::init($ctx);
array_unshift($this->view_path, 'views_mobile');
session_start();
$this->openid = $_SESSION['wx_openid'];
$this->layout = 'v2_layout';
}
示例3: init
public function init()
{
parent::init();
global $databaseConfig;
SS_Log::log(new Exception(print_r($databaseConfig, true)), SS_Log::NOTICE);
$this->dbType = $databaseConfig['type'];
$_REQUEST['showqueries'] = 1;
}
示例4: init
public function init()
{
/* Initialize action controller here */
parent::init();
$this->auth = AuthFactory::create(AuthFactory::$AGENT, $this->db, $this->_request);
$this->chatRequestModel = new Chat_Request($this->db);
$this->chatSessionModel = new Chat_Session($this->db);
$this->appChatRequestModel = new App_ChatRequest();
$this->leadModel = new App_Lead();
$this->agentModel = new App_Agent();
}
示例5: init
/**
* !CodeTemplates.overridecomment.nonjd!
* @see CController::init()
*/
public function init()
{
parent::init();
if ($this->_setting['site_status'] == 'close') {
//网站关闭
$encode_intro = CHtml::encode($this->_setting['site_status_intro']);
$site_name = CHtml::encode($this->_setting['site_name']);
echo <<<EOT
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>{$site_name}</title>
</head>
<body>
<p style="width:800px; line-height:40px; margin:0 auto; margin-top:50px; color:#FFFFFF; text-align:center; background-color:#3C5880;">{$encode_intro}</p>
</body>
</html>\t
EOT;
exit;
}
//前端ip访问控制
$cur_ip = Yii::app()->request->userHostAddress;
if ($this->_setting['deny_access_ip']) {
$access_ips = explode("\r\n", trim($this->_setting['deny_access_ip']));
$access = Helper::ipAccess($cur_ip, $access_ips);
if (!$access) {
throw new CHttpException(403, '403 Forbidden!');
}
}
//主题设置
Yii::app()->theme = $this->_setting['theme'];
$this->_stylePath = Yii::app()->theme->baseUrl . '/styles';
//菜单导航
$menus = Menu::model()->findAll('status =:status ORDER BY sort_order, id', array(':status' => 'Y'));
$tree = new Xtree();
foreach ((array) $menus as $menu) {
$data[] = $menu->attributes;
}
$tree->setTree($data, 'id', 'parent_id', array('menu_name', 'menu_link', 'unique', 'target'));
$this->_public_menu = $tree->getArrayList(0);
$this->_cur_url = Yii::app()->request->getUrl();
//登录状态
if (!Yii::app()->user->getIsGuest()) {
$this->_login_status = true;
}
//加载公共资源
Yii::app()->clientScript->registerCssFile($this->_stylePath . "/css/global.css");
}
示例6: init
public function init()
{
parent::init();
$this->auth = AuthFactory::create(AuthFactory::$OWNER, $this->db, $this->_request);
$this->model = new Owner_Owner($this->db);
$this->model->setRequestObject($this->_request);
$this->ownerModel = new App_Owner();
$this->timezoneModel = new App_Timezone();
$this->timezoneGroupModel = new App_TimezoneGroup();
$this->businessTypeModel = new App_BusinessType();
$this->numberOfHitModel = new App_NumberOfHit();
$this->leadModel = new App_Lead();
$this->memberModel = new App_Member();
$this->baseUrlDashboard = $this->baseUrl . "/js/leadschat-dashboard";
}
示例7: init
public function init()
{
parent::init();
$this->_static_admin = 'styles';
}
示例8: init
public function init()
{
parent::init();
$this->model = new App_NumberOfHit();
}
示例9: init
public function init()
{
parent::init();
}
示例10: init
public function init()
{
parent::init();
$this->model = new App_Timezone();
}
示例11: init
public function init()
{
$this->leadModel = new App_Lead();
$this->ownerModel = new App_Owner();
parent::init();
}
示例12: init
public function init()
{
parent::init();
$this->model = new App_Agent();
}
示例13: init
public function init()
{
parent::init();
$this->model = new App_Country();
}
示例14: init
function init($ctx)
{
parent::init($ctx);
// your codes here...
}
示例15: init
protected function init()
{
parent::init();
}