本文整理汇总了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'));
}
}
示例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);
}
}
}
示例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();
}
示例4: init
public function init()
{
parent::init();
if (!$this->model instanceof ActiveRecord) {
throw new CException("Параметр model Должен быть объектом класса ActiveRecord");
}
}
示例5: init
public function init()
{
parent::init();
if ($this->model === null) {
throw new CException("Параметр model является обязательным");
}
}
示例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);
}
}
示例7: init
/**
* Container Initializer
*
* @access private
*/
function init()
{
$this->_items = array();
$this->_packable = true;
$this->_useTitles = false;
$this->_familyWidget = 'container';
parent::init();
}
示例8: init
public function init()
{
parent::init();
Html::addCssClass($this->options, ['weui_grid']);
if (!isset($this->options['href'])) {
$this->options['href'] = "javascript:;";
}
}
示例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";
}
示例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);
}
示例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}();
}
示例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};";
}
}
示例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';
}
}
示例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);
}
示例15: init
public function init()
{
parent::init();
$this->registerScripts();
}