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


PHP Typecho_Widget::__construct方法代码示例

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


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

示例1: __construct

 /**
  * 构造函数,初始化组件
  *
  * @access public
  * @param mixed $request request对象
  * @param mixed $response response对象
  * @param mixed $params 参数列表
  * @return void
  */
 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     /** 初始化常用组件 */
     $this->options = $this->widget('Widget_Options');
     $this->user = $this->widget('Widget_User');
 }
开发者ID:Jsechoo,项目名称:sisome,代码行数:16,代码来源:Menu.php

示例2: __construct

 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     /* 获取数据库对象、配置及用户 */
     $this->_db = Typecho_Db::get();
     $this->_options = Typecho_Widget::widget('Widget_Options');
 }
开发者ID:duxiangfei,项目名称:plugins,代码行数:7,代码来源:Action.php

示例3: __construct

 /**
  * 构造函数
  *
  * @access public
  * @param mixed $request request对象
  * @param mixed $response response对象
  * @param mixed $params 参数列表
  */
 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     $this->notice = parent::widget('Widget_Notice');
     $this->options = parent::widget('Widget_Options');
     $this->config = $this->options->plugin('Passport');
 }
开发者ID:TPlugin,项目名称:Passport,代码行数:15,代码来源:Widget.php

示例4: __construct

 /**
  * 构造函数,初始化组件
  *
  * @access public
  * @param mixed $request request对象
  * @param mixed $response response对象
  * @param mixed $params 参数列表
  */
 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     /** 初始化数据库 */
     $this->db = Typecho_Db::get();
     $this->options = $this->widget('Widget_Options');
 }
开发者ID:r0ker,项目名称:hctf2015-all-problems,代码行数:15,代码来源:User.php

示例5: __construct

 /**
  * 构造函数,初始化组件
  *
  * @access public
  * @param mixed $request request对象
  * @param mixed $response response对象
  * @param mixed $params 参数列表
  * @return void
  */
 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     /** 初始化数据库 */
     $this->db = Typecho_Db::get();
     /** 初始化常用组件 */
     $this->user = $this->widget('Widget_User');
 }
开发者ID:menmenweiwei,项目名称:blog,代码行数:17,代码来源:Stat.php

示例6: __construct

 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     $this->db = Typecho_Db::get();
     $this->options = Helper::options();
     //$this->pluginRootUrl = Typecho_Common::url('Api/', $this->options->pluginUrl);
     require_once 'Twig/Autoloader.php';
     Twig_Autoloader::register();
 }
开发者ID:jiusanzhou,项目名称:spacms,代码行数:9,代码来源:Action.php

示例7: __construct

 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     $this->_db = Typecho_Db::get();
     $this->_options = Helper::options()->plugin('WeChatHelper');
     $this->_textTpl = "<xml>\n                            <ToUserName><![CDATA[%s]]></ToUserName>\n                            <FromUserName><![CDATA[%s]]></FromUserName>\n                            <CreateTime>%s</CreateTime>\n                            <MsgType><![CDATA[text]]></MsgType>\n                            <Content><![CDATA[%s]]></Content>\n                            <FuncFlag>0</FuncFlag>\n                            </xml>";
     $this->_imageTpl = "<xml>\n                             <ToUserName><![CDATA[%s]]></ToUserName>\n                             <FromUserName><![CDATA[%s]]></FromUserName>\n                             <CreateTime>%s</CreateTime>\n                             <MsgType><![CDATA[news]]></MsgType>\n                             <ArticleCount>%s</ArticleCount>\n                             <Articles>%s</Articles>\n                             <FuncFlag>1</FuncFlag>\n                             </xml>";
     $this->_itemTpl = "<item>\n                             <Title><![CDATA[%s]]></Title> \n                             <Description><![CDATA[%s]]></Description>\n                             <PicUrl><![CDATA[%s]]></PicUrl>\n                             <Url><![CDATA[%s]]></Url>\n                             </item>";
 }
开发者ID:duxiangfei,项目名称:plugins,代码行数:9,代码来源:Action.php

示例8: __construct

 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     $this->_db = Typecho_Db::get();
     $this->_dir = '.' . __TYPECHO_PLUGIN_DIR__ . '/CommentToMail/';
     $this->_set = Helper::options()->plugin('CommentToMail');
     require_once $this->_dir . 'class.phpmailer.php';
     $this->mail = new PHPMailer();
 }
开发者ID:daixl2010,项目名称:Typecho-Nesoft-Theme,代码行数:9,代码来源:Action.php

示例9: __construct

 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     $this->parameter->setDefault(array('type' => NULL));
     /** 初始化常用组件 */
     $this->options = $this->widget('Widget_Options');
     $this->user = $this->widget('Widget_User');
     /** 初始化皮肤路径 */
     $this->_themeDir = rtrim($this->options->themeFile($this->options->theme), '/') . '/';
     if (NULL == $this->parameter->type) {
         $this->parameter->type = Typecho_Router::$current;
     }
 }
开发者ID:dccecc,项目名称:typecho,代码行数:13,代码来源:Front.php

示例10: __construct

 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     $this->db = Typecho_Db::get();
     $this->options = $this->widget('Widget_Options');
     $this->bakpath = dirname(__FILE__) . DIRECTORY_SEPARATOR . $this->bakdir . DIRECTORY_SEPARATOR;
     $baknum = intval(Typecho_Widget::widget('Widget_Options')->plugin('TEDbBak')->baknum);
     if ($baknum > 0) {
         $this->limit = $baknum;
     }
     if (!is_dir($this->bakpath)) {
         mkdir($this->bakpath);
     }
 }
开发者ID:nbdarling,项目名称:typechoi7-master,代码行数:14,代码来源:Action.php

示例11: __construct

 /**
  * 构造函数,初始化组件
  *
  * @access public
  * @param mixed $request request对象
  * @param mixed $response response对象
  * @param mixed $params 参数列表
  */
 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     /** 初始化数据库 */
     $this->db = Typecho_Db::get();
     /** 初始化常用组件 */
     $this->options = $this->widget('Widget_Options');
     $this->user = $this->widget('Widget_User');
     $this->security = $this->widget('Widget_Security');
     $this->_themeDir = rtrim($this->options->themeFile($this->options->theme), '/') . '/';
     /** 加载皮肤函数 */
     $functionsFile = $this->_themeDir . 'functions.php';
     if (!$this->_invokeFromOutside && file_exists($functionsFile)) {
         require_once $functionsFile;
     }
 }
开发者ID:dccecc,项目名称:typecho,代码行数:24,代码来源:Abstract.php

示例12: __construct

 /**
  * 构造方法
  *
  * @access public
  * @var void
  */
 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     /* 获取插件配置 */
     $options = parent::widget('Widget_Options');
     $this->_config = $options->plugin('Remix');
     /* 初始服务标识 */
     if (isset($request->serve) && !empty($request->serve)) {
         static::$serve = $request->filter('strip_tags', 'trim', 'xss')->serve;
     } else {
         static::$serve = 'xiami';
     }
     /* 判断来路 */
     $siteParts = parse_url($options->siteUrl);
     $refParts = parse_url($request->getReferer());
     $hash = $request->getServer('HTTP_REMIX_HASH');
     if (!$request->isAjax() || $siteParts['host'] != $refParts['host'] || !Typecho_Common::hashValidate($this->_config->hash, $hash)) {
         throw new Typecho_Widget_Exception(_t('Bad Request!'), 403);
     }
 }
开发者ID:actcms,项目名称:Remix,代码行数:26,代码来源:Action.php

示例13: __construct

 /**
  * 构造函数
  *
  * @param mixed $request
  * @param mixed $response
  * @param null $params
  */
 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     //检测是否可以自动下载安装
     $tempDir = __TYPECHO_ROOT_DIR__ . __TYPECHO_PLUGIN_DIR__ . '/.app_store/';
     if (!@touch($tempDir . '.installable' . time())) {
         $this->installale = false;
     } else {
         unlink($tempDir . '.installable' . time());
     }
     //如果没有json库,加载兼容包
     !extension_loaded('json') and (include 'libs/compat_json.php');
     //加载unzip包
     include 'libs/unzip.php';
     //加载助手
     include 'helpers/helpers.php';
     //加载异常类
     include 'libs/exceptions.php';
     //从插件设置中读取应用商店服务器地址
     $this->server = Typecho_Widget::widget('Widget_Options')->plugin('AppStore')->server;
     define('TYPEHO_ADMIN_PATH', __TYPECHO_ROOT_DIR__ . __TYPECHO_ADMIN_DIR__ . '/');
 }
开发者ID:xau0at,项目名称:AppStore,代码行数:29,代码来源:Action.php

示例14: __construct

 /**
  * 构造方法
  *
  * @access public
  * @var void
  */
 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     /* 获取插件配置 */
     $this->_config = parent::widget('Widget_Options')->plugin('BaiduSlug');
 }
开发者ID:gischuck,项目名称:BaiduSlug,代码行数:12,代码来源:Action.php

示例15: __construct

 public function __construct($request, $response, $params = NULL)
 {
     parent::__construct($request, $response, $params);
     $this->config = Helper::options()->plugin(self::$pluginName);
     $this->db = Typecho_Db::get();
 }
开发者ID:duxiangfei,项目名称:plugins,代码行数:6,代码来源:AuthorizeAction.php


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