当前位置: 首页>>代码示例>>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;未经允许,请勿转载。