當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Widget::__construct方法代碼示例

本文整理匯總了PHP中yii\base\Widget::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Widget::__construct方法的具體用法?PHP Widget::__construct怎麽用?PHP Widget::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yii\base\Widget的用法示例。


在下文中一共展示了Widget::__construct方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct($config = [])
 {
     parent::__construct($config);
     if (!$this->transaction instanceof OrderTransaction) {
         $this->transaction = new OrderTransaction();
     }
 }
開發者ID:heartshare,項目名稱:dotplant2,代碼行數:7,代碼來源:AbstractPayment.php

示例2: __construct

 public function __construct($config = [])
 {
     //by default both opengraph and microdata are enabled, disable if ['enable' => false] was explicitly passed to widget
     $config['og'] = array_merge($this->og, isset($config['og']) ? $config['og'] : []);
     $config['md'] = array_merge($this->md, isset($config['md']) ? $config['md'] : []);
     parent::__construct($config);
 }
開發者ID:kansey,項目名稱:yii2albom,代碼行數:7,代碼來源:ImageX.php

示例3: __construct

 public function __construct($config = [])
 {
     $this->_config = $config;
     try {
         parent::__construct($config);
     } catch (WidgetMissedIdException $e) {
         throw $e;
     } catch (\Exception $e) {
         $this->processException($e);
     }
 }
開發者ID:gromver,項目名稱:yii2-platform,代碼行數:11,代碼來源:Widget.php

示例4: __construct

 public function __construct($config = [])
 {
     if (count($config) > 0) {
         $this->action = empty($config['action']) ? \Yii::$app->controller->action->id : $config['action'];
         $this->selector = empty($config['selector']) ? 'ctype' : $config['selector'];
         $this->ctype = empty($config[$this->selector]) ? '' : $config[$this->selector];
     } else {
         $this->action = \Yii::$app->controller->action->id;
         $this->ctype = !empty(\Yii::$app->getRequest()->getQueryParam($this->selector)) ? \Yii::$app->getRequest()->getQueryParam($this->selector) : 'page';
     }
     parent::__construct();
     // TODO: Change the autogenerated stub
 }
開發者ID:giantbits,項目名稱:yii2-crelish,代碼行數:13,代碼來源:ElementNav.php

示例5: __construct

 public function __construct(BuildingFinderInterface $buildingFinder, $config = [])
 {
     $this->buildingFinder = $buildingFinder;
     parent::__construct($config);
 }
開發者ID:iw-reload,項目名稱:iw,代碼行數:5,代碼來源:ConstructionWidget.php

示例6: __construct

 public function __construct(BlogFinder $finder, $config = [])
 {
     $this->finder = $finder;
     parent::__construct($config);
 }
開發者ID:jarrus90,項目名稱:yii2-blog,代碼行數:5,代碼來源:Sidebar.php


注:本文中的yii\base\Widget::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。