當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。