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


PHP Widget::init方法代碼示例

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


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

示例1: init

 /**
  * Widget's initialization method
  */
 public function init()
 {
     parent::init();
     if (empty($this->data)) {
         throw new CException(Yii::t('zii', '"data" attribute cannot be blank'));
     }
 }
開發者ID:abudayah,項目名稱:yiiwheels-custom,代碼行數:10,代碼來源:Sparklines.php

示例2: init

 public function init()
 {
     parent::init();
     $session = \Yii::$app->session;
     $flashes = $session->getAllFlashes();
     $appendCss = isset($this->options['class']) ? ' ' . $this->options['class'] : '';
     foreach ($flashes as $type => $data) {
         if (isset($this->alertTypes[$type])) {
             $data = (array) $data;
             foreach ($data as $i => $message) {
                 /* initialize css class for each alert box */
                 $this->options['class'] = $this->alertTypes[$type] . $appendCss;
                 /* assign unique id to each alert box */
                 $this->options['id'] = $this->getId() . '-' . $type . '-' . $i;
                 $this->renderHtml($message, $this->options['class']);
                 //                    echo \yii\bootstrap\Alert::widget([
                 //                        'body' => $message,
                 //                        'closeButton' => $this->closeButton,
                 //                        'options' => $this->options,
                 //                    ]);
             }
             $session->removeFlash($type);
         }
     }
 }
開發者ID:foundationize,項目名稱:yii2-foundation,代碼行數:25,代碼來源:FnAlert.php

示例3: render

 public function render(Register $parameters, XMLDocument &$document)
 {
     Widget::init($this->document);
     $this->appendHead($this->document->documentElement);
     $this->appendBody($this->document->documentElement);
     return $this->document->saveHTML();
 }
開發者ID:brendo,項目名稱:symphony-3,代碼行數:7,代碼來源:class.devkit.php

示例4: init

 public function init()
 {
     parent::init();
     if (!$this->model instanceof ActiveRecord) {
         throw new CException("Параметр model Должен быть объектом класса ActiveRecord");
     }
 }
開發者ID:blindest,項目名稱:Yii-CMS-2.0,代碼行數:7,代碼來源:RatingWidget.php

示例5: init

 public function init()
 {
     parent::init();
     if ($this->model === null) {
         throw new CException("Параметр model является обязательным");
     }
 }
開發者ID:blindest,項目名稱:Yii-CMS-2.0,代碼行數:7,代碼來源:CommentsPortlet.php

示例6: init

 /**
  * Initializes the widget.
  * If you override this method, make sure you call the parent implementation first.
  */
 public function init()
 {
     parent::init();
     $this->clientOptions = false;
     if ($this->defaultClass) {
         Html::addCssClass($this->options, $this->defaultClass);
     }
 }
開發者ID:talview,項目名稱:yii2-materialize,代碼行數:12,代碼來源:Button.php

示例7: init

 /**
  * Container Initializer
  *
  * @access private
  */
 function init()
 {
     $this->_items = array();
     $this->_packable = true;
     $this->_useTitles = false;
     $this->_familyWidget = 'container';
     parent::init();
 }
開發者ID:Dulciane,項目名稱:jaws,代碼行數:13,代碼來源:Container.php

示例8: init

 public function init()
 {
     parent::init();
     Html::addCssClass($this->options, ['weui_grid']);
     if (!isset($this->options['href'])) {
         $this->options['href'] = "javascript:;";
     }
 }
開發者ID:xjflyttp,項目名稱:yii2-weui-widget,代碼行數:8,代碼來源:GridItem.php

示例9: init

 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     $this->initOptions();
     echo $this->renderToggleButton() . "\n";
     echo Html::beginTag('div', $this->options) . "\n";
     echo Html::beginTag('div', ['class' => 'modal-content']) . "\n";
 }
開發者ID:talview,項目名稱:yii2-materialize,代碼行數:11,代碼來源:Modal.php

示例10: __construct

 public function __construct()
 {
     parent::__construct();
     self::$Headers = new DocumentHeaders();
     self::$Document = new XMLDocument();
     self::$Document->appendChild(self::$Document->createElement('data'));
     Widget::init(self::$Document);
 }
開發者ID:symphonycms,項目名稱:symphony-3,代碼行數:8,代碼來源:class.frontend.php

示例11: init

 public function init()
 {
     parent::init();
     if (!isset($this->appendToParent)) {
         $this->appendToParent = isset(self::$appendToParents[$this->plugin]) ? self::$appendToParents[$this->plugin] : 'appendDivToParent';
     }
     $this->{$this->appendToParent}();
 }
開發者ID:tqsq2005,項目名稱:yii2-jeasyui,代碼行數:8,代碼來源:Easy.php

示例12: init

 /**
  * @inheritdoc
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     $this->view = 'disqus-comments';
     $this->params['credits'] = $this->credits;
     $this->params['noScript'] = $this->noScript;
     parent::init();
     if (!empty($this->language)) {
         $this->params['variables'] .= "\n\tvar disqus_config = function(){\n\t\tthis.language = '{$this->language}';\n\t};";
     }
 }
開發者ID:laojiu,項目名稱:yii2-disqus-widget,代碼行數:14,代碼來源:Comments.php

示例13: init

 public function init()
 {
     parent::init();
     if (null === $this->maskId) {
         $this->maskId = $this->getId() . '_mask';
     }
     if (null === $this->actionsheetId) {
         $this->actionsheetId = $this->getId() . '_actionsheet';
     }
 }
開發者ID:xjflyttp,項目名稱:yii2-weui-widget,代碼行數:10,代碼來源:ActionSheet.php

示例14: initialize

 /**
  * Initializes objects and properties common to all SymphonyView
  * objects
  */
 public function initialize()
 {
     // Initialize headers
     $this->headers = new DocumentHeaders();
     $this->setHeaders();
     // Initialize context
     $this->context = new Register();
     // Initialize XML
     $this->document = new XMLDocument();
     $this->document->appendChild($this->document->createElement('data'));
     //Initialize XSLT
     $this->stylesheet = new XMLDocument();
     Widget::init($this->document);
 }
開發者ID:symphonycms,項目名稱:symphony-3,代碼行數:18,代碼來源:class.view.php

示例15: init

 public function init()
 {
     parent::init();
     $this->registerScripts();
 }
開發者ID:blindest,項目名稱:Yii-CMS-2.0,代碼行數:5,代碼來源:VideoPlayer.php


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