当前位置: 首页>>代码示例>>PHP>>正文


PHP AppController::init方法代码示例

本文整理汇总了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!");
     }
 }
开发者ID:alencarmo,项目名称:OCF,代码行数:27,代码来源:settings.php

示例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';
 }
开发者ID:zxw5775,项目名称:yuhunclub,代码行数:8,代码来源:bind.php

示例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;
 }
开发者ID:Cumquat,项目名称:silverstripe-orientdb-poc,代码行数:8,代码来源:PerformanceController.php

示例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();
 }
开发者ID:redhattaccoss,项目名称:Leadschat,代码行数:11,代码来源:AgentsController.php

示例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");
    }
开发者ID:manjingzi,项目名称:yiifcms,代码行数:53,代码来源:FrontBase.php

示例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";
 }
开发者ID:redhattaccoss,项目名称:Leadschat,代码行数:15,代码来源:OwnersController.php

示例7: init

 public function init()
 {
     parent::init();
     $this->_static_admin = 'styles';
 }
开发者ID:jerrylsxu,项目名称:yiifcms,代码行数:5,代码来源:BackendBase.php

示例8: init

 public function init()
 {
     parent::init();
     $this->model = new App_NumberOfHit();
 }
开发者ID:redhattaccoss,项目名称:Leadschat,代码行数:5,代码来源:NumberOfHitsController.php

示例9: init

 public function init()
 {
     parent::init();
 }
开发者ID:Cumquat,项目名称:silverstripe-orientdb-poc,代码行数:4,代码来源:SandboxController.php

示例10: init

 public function init()
 {
     parent::init();
     $this->model = new App_Timezone();
 }
开发者ID:redhattaccoss,项目名称:Leadschat,代码行数:5,代码来源:TimezonesController.php

示例11: init

 public function init()
 {
     $this->leadModel = new App_Lead();
     $this->ownerModel = new App_Owner();
     parent::init();
 }
开发者ID:redhattaccoss,项目名称:Leadschat,代码行数:6,代码来源:LeadsController.php

示例12: init

 public function init()
 {
     parent::init();
     $this->model = new App_Agent();
 }
开发者ID:redhattaccoss,项目名称:Leadschat,代码行数:5,代码来源:QaController.php

示例13: init

 public function init()
 {
     parent::init();
     $this->model = new App_Country();
 }
开发者ID:redhattaccoss,项目名称:Leadschat,代码行数:5,代码来源:CountriesController.php

示例14: init

 function init($ctx)
 {
     parent::init($ctx);
     // your codes here...
 }
开发者ID:ccyun,项目名称:iphp,代码行数:5,代码来源:index.php

示例15: init

 protected function init()
 {
     parent::init();
 }
开发者ID:stefangruncharov,项目名称:url-shortening-service,代码行数:4,代码来源:FormController.php


注:本文中的AppController::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。