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


PHP Action::__construct方法代码示例

本文整理汇总了PHP中Action::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Action::__construct方法的具体用法?PHP Action::__construct怎么用?PHP Action::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Action的用法示例。


在下文中一共展示了Action::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

    /**
     * 构造方法-初始化数据
     */
    public function __construct() {
        parent::__construct();
        $this->_model = loadModel('Index');
        $this->_admin_model = loadModel('Admin.Admin');
        $this->_config = array('verify_error' => '验证码错误', 'userNull' => '用户信息不能为空', 'userError' => '用户名密码错误');
        $this->_username = $this->getParam("username");
        $this->_password = $this->getParam("password");
        $this->_verify = $this->getParam("verify");
        $this->_p = $this->getParam('p') ? intval($this->getParam('p')) : 0;
        $this->_openid = $this->getParam("openid");
        $this->_memberEdit = $this->getParam("memberEdit");
        $this->_member = $this->getParam("member");
        $this->_cardid = $this->getParam("cardid");

        //获取card id
        $this->_card_id = $this->getParam('card_id');
        if (!$this->_card_id) {
            $id = $this->getParam('id') ? intval($this->getParam('id')) : 1;
            $this->_card_id = $this->_model->getCardId($id);
        }

        //验证是否登录用户
        if ((!isset($_COOKIE['huishi_admin_uid']) || !$_COOKIE['huishi_admin_uid']) && ($this->getParam("m") != 'login') && ($this->getParam("m") != 'index') && ($this->getParam("m") != 'verify')) {
            header('location:' . url('index', 'index', array(), 'admin.php'));
            exit();
        }
    }
开发者ID:neil-chen,项目名称:NeilChen,代码行数:30,代码来源:IndexAction.class.php

示例2: __construct

 public function __construct()
 {
     parent::__construct();
     $path = C('PROJECT.SITE_PATH') . '/' . $_GET['site'] . '/' . C('PROJECT.SRC_DIR') . '/' . $_GET['module'] . '/' . C('M3D_FILENAME');
     //        $path = '/home/music/javey/music_1-0-165-34_BRANCH/m3d.php';
     $this->tool = new InstantmergeTool($path);
 }
开发者ID:chenyongze,项目名称:m3d,代码行数:7,代码来源:ImergeAction.class.php

示例3: __construct

 public function __construct()
 {
     parent::__construct();
     $this->page = M('page');
     //实例化一个数据模型
     $this->article = M('article');
 }
开发者ID:BUG87,项目名称:BUS-REPOSITORY-TP,代码行数:7,代码来源:BugAction.class.php

示例4: __construct

 public function __construct($data = '')
 {
     $this->param = $data;
     $this->setServerId($this->param['from_server_id']);
     $this->player_id = $this->param['from_player_id'];
     parent::__construct();
 }
开发者ID:bluefan,项目名称:phpsource,代码行数:7,代码来源:CrossBase.php

示例5: __construct

 public function __construct()
 {
     parent::__construct();
     $this->_manage = new ManageModel();
     $this->_goods = new GoodsModel();
     $this->_order = new OrderModel();
 }
开发者ID:yjf0503,项目名称:Mall,代码行数:7,代码来源:AdminAction.class.php

示例6: __construct

 /**
  * @param Grido\Grid $grid
  * @param string $name
  * @param string $label
  * @param callback $onClick
  */
 public function __construct($grid, $name, $label, $onClick = NULL)
 {
     parent::__construct($grid, $name, $label);
     if ($onClick !== NULL) {
         $this->onClick[] = $onClick;
     }
 }
开发者ID:cujan,项目名称:atlashornin,代码行数:13,代码来源:Event.php

示例7: __construct

 /**
  * Initializes a new instance of a AMQP action to report
  */
 public function __construct($method, $target, $routingKey = '')
 {
     parent::__construct();
     $this->method = $method;
     $this->target = $target;
     $this->routingKey = $routingKey;
 }
开发者ID:nasqueron,项目名称:notifications,代码行数:10,代码来源:AMQPAction.php

示例8:

 function __construct()
 {
     parent::__construct();
     //        if(MODULE_NAME != 'Index') $this->iM = D(MODULE_NAME);
     $this->quoteRequestData();
     $this->assignGlobalData();
 }
开发者ID:bennylii,项目名称:waterfall,代码行数:7,代码来源:CommonAction.class.php

示例9: __construct

 public function __construct()
 {
     parent::__construct();
     $this->goods = new GoodsModel();
     $this->rotator = new RotatorModel();
     $this->user = new UserModel();
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:7,代码来源:PicAction.class.php

示例10: __construct

 public function __construct()
 {
     parent::__construct();
     $this->_aBaseOptions = (require CONF_PATH . 'dataConfig.inc.php');
     $this->para = $_REQUEST;
     if (empty($_SESSION['app_index'])) {
         $_SESSION['app_index'] = (array) C('APP_INFO');
     }
     $this->oApp = $_SESSION['app_index'];
     $uid = D('Session')->check();
     if ($uid) {
         $user = D('User')->where(array('id' => $uid))->find();
         $_SESSION['user'] = $user;
         $this->oUser = $user;
         #用户名
         $this->assign('user', $this->oUser);
         #未读私信数
         $this->assign('letterCount', D('Letter')->where(array('recipient' => $uid, 'isread' => 0))->count());
         $collect['case'] = D('collect')->where(array('uid' => $this->oUser['id'], 'type' => 1))->select();
         $collect['house'] = D('collect')->where(array('uid' => $this->oUser['id'], 'type' => 2))->select();
         $collect['active'] = D('collect')->where(array('uid' => $this->oUser['id'], 'type' => 3))->select();
         $_SESSION['collect'] = $collect;
         $this->oCollect = $collect;
     } else {
         unset($_SESSION['user']);
         $this->oUser = array();
     }
     $this->assign('hot_designer', D('User_designer')->getHotDesigner());
     $this->assign('hot_case', D('Case')->getHotCase());
 }
开发者ID:noikiy,项目名称:yisheji,代码行数:30,代码来源:BaseAction.class.php

示例11: __construct

 public function __construct()
 {
     parent::__construct();
     $this->article = M("article");
     $this->note = M("guestbook");
     $this->product = M("product");
 }
开发者ID:BUG87,项目名称:BUS-REPOSITORY-TP,代码行数:7,代码来源:IndexAction.class.php

示例12: __construct

 public function __construct($tpl)
 {
     //构造方法 初始化
     global $templates;
     parent::__construct($tpl);
     //初始化父类
 }
开发者ID:hachi-zzq,项目名称:guest-cms,代码行数:7,代码来源:IndexAction.class.php

示例13: __construct

 public function __construct()
 {
     parent::__construct();
     global $mobile_cfg;
     if ($mobile_cfg == null) {
         $mobile_cfg = (require_once APP_ROOT_PATH . "system/mobile_cfg/" . APP_TYPE . "/webnav_cfg.php");
     }
     check_install();
     //重新处理后台的语言加载机制,后台语言环境配置于后台config.php文件
     $langSet = conf('DEFAULT_LANG');
     // 定义当前语言
     define('LANG_SET', strtolower($langSet));
     // 读取项目公共语言包
     if (is_file(LANG_PATH . $langSet . '/common.php')) {
         L(include LANG_PATH . $langSet . '/common.php');
         $this->lang_pack = (require LANG_PATH . $langSet . '/common.php');
         if (!file_exists(APP_ROOT_PATH . "public/runtime/admin/lang.js")) {
             $str = "var LANG = {";
             foreach ($this->lang_pack as $k => $lang) {
                 $str .= "\"" . $k . "\":\"" . $lang . "\",";
             }
             $str = substr($str, 0, -1);
             $str .= "};";
             file_put_contents(APP_ROOT_PATH . "public/runtime/admin/lang.js", $str);
         }
     }
     es_session::close();
 }
开发者ID:macall,项目名称:jsd,代码行数:28,代码来源:BaseAction.class.php

示例14: __construct

 public function __construct()
 {
     parent::__construct();
     $this->product = M('product');
     import('ORG.Util.Page');
     //分页
 }
开发者ID:BUG87,项目名称:BUS-REPOSITORY-TP,代码行数:7,代码来源:ProductAction.class.php

示例15: __construct

 public function __construct()
 {
     parent::__construct();
     check_install();
     //重新处理后台的语言加载机制,后台语言环境配置于后台config.php文件
     $langSet = conf('DEFAULT_LANG');
     // 定义当前语言
     define('LANG_SET', strtolower($langSet));
     // 读取项目公共语言包
     if (is_file(LANG_PATH . $langSet . '/common.php')) {
         L(include LANG_PATH . $langSet . '/common.php');
         $this->lang_pack = (require LANG_PATH . $langSet . '/common.php');
         if (is_file(LANG_PATH . $langSet . '/weixin.php')) {
             L(include LANG_PATH . $langSet . '/weixin.php');
             $weixin_lang = (require LANG_PATH . $langSet . '/weixin.php');
             $this->lang_pack = array_merge($this->lang_pack, $weixin_lang);
         }
         if (!file_exists(APP_ROOT_PATH . "public/runtime/admin/lang.js")) {
             $str = "var LANG = {";
             foreach ($this->lang_pack as $k => $lang) {
                 $str .= "\"" . $k . "\":\"" . $lang . "\",";
             }
             $str = substr($str, 0, -1);
             $str .= "};";
             file_put_contents(APP_ROOT_PATH . "public/runtime/admin/lang.js", $str);
         }
     }
 }
开发者ID:centaurustech,项目名称:crowdfunding-9,代码行数:28,代码来源:BaseAction.class.php


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