init() 공개 메소드

This method will initialize required property values.
public init ( )
예제 #1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     if (empty($this->attributes)) {
         $this->attributes = $this->attributes();
     }
     parent::init();
 }
예제 #2
0
 public function init()
 {
     parent::init();
     if ($this->model instanceof \common\components\model\Translateable) {
         $attributes = [];
         foreach ($this->attributes as $attribute) {
             $attributes[] = $attribute;
             if ($this->model->isTranslateAttribute($attribute['attribute'])) {
                 foreach ($this->model->getTranslationModels() as $model) {
                     $attribute['label'] = $model->getAttributeLabel($attribute['attribute']);
                     $attribute['value'] = $model->{$attribute['attribute']};
                     $attributes[] = $attribute;
                 }
             }
         }
         $this->attributes = $attributes;
     }
 }
예제 #3
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     $this->initWidget();
     parent::init();
 }
예제 #4
0
 public function init()
 {
     parent::init();
     $this->initOption();
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     $this->validateDisplay();
     if ($this->bootstrap) {
         Html::addCssClass($this->options, 'table');
         if ($this->hover) {
             Html::addCssClass($this->options, 'table-hover');
         }
         if ($this->bordered) {
             Html::addCssClass($this->options, 'table-bordered');
         }
         if ($this->condensed) {
             Html::addCssClass($this->options, 'table-condensed');
         }
         $this->_childTableOptions = $this->options;
         if ($this->striped) {
             Html::addCssClass($this->options, 'table-striped');
         }
     }
     Html::addCssClass($this->_childTableOptions, 'kv-child-table');
     Html::addCssClass($this->options, 'detail-view');
     Html::addCssStyle($this->labelColOptions, "text-align:{$this->hAlign};vertical-align:{$this->vAlign};");
     parent::init();
     if (empty($this->container['id'])) {
         $this->container['id'] = $this->getId();
     }
     $this->initI18N(__DIR__);
     $this->formOptions['fieldConfig']['template'] = "{input}\n{hint}\n{error}";
     $this->_form = ActiveForm::begin($this->formOptions);
     Html::addCssClass($this->alertContainerOptions, 'panel-body kv-alert-container');
     $this->alertMessageSettings += ['kv-detail-error' => 'alert alert-danger', 'kv-detail-success' => 'alert alert-success', 'kv-detail-info' => 'alert alert-info', 'kv-detail-warning' => 'alert alert-warning'];
     $this->registerAssets();
 }
예제 #6
0
 /**
  * Initialises the widget
  */
 public function init()
 {
     if (!isset($this->microformat)) {
         throw new InvalidConfigException('The "microformat" property must be specified.');
     } elseif (strpos($this->microformat, self::ROOT_PREFIX) !== 0) {
         throw new InvalidConfigException(strtr('Invalid root microformat class: "{microformat}".', ['{microformat}' => $this->microformat]));
     }
     parent::init();
 }
예제 #7
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     $this->validateAttributes();
     Html::addCssClass($this->options, 'detail-view');
     $this->validateDisplay();
     if ($this->bootstrap) {
         Html::addCssClass($this->options, 'table');
         if ($this->hover) {
             Html::addCssClass($this->options, 'table-hover');
         }
         if ($this->bordered) {
             Html::addCssClass($this->options, 'table-bordered');
         }
         if ($this->striped) {
             Html::addCssClass($this->options, 'table-striped');
         }
         if ($this->condensed) {
             Html::addCssClass($this->options, 'table-condensed');
         }
     }
     Html::addCssStyle($this->labelColOptions, "text-align:{$this->hAlign};vertical-align:{$this->vAlign};");
     parent::init();
     if (empty($this->container['id'])) {
         $this->container['id'] = $this->getId();
     }
     $this->initI18N(__DIR__);
     $this->template = Html::beginTag('tr', $this->rowOptions) . "\n" . Html::beginTag('th', $this->labelColOptions) . "\n{label}</th>\n" . Html::beginTag('td', $this->valueColOptions) . "\n{label}</td>\n" . "</tr>";
     Html::addCssClass($this->formOptions, 'kv-detail-view-form');
     $this->formOptions['fieldConfig']['template'] = "{input}\n{hint}\n{error}";
     $this->_form = ActiveForm::begin($this->formOptions);
     $this->registerAssets();
 }
예제 #8
0
파일: DetailView.php 프로젝트: vfokov/tims2
 public function init()
 {
     parent::init();
     DetailViewAsset::register($this->getView());
 }
예제 #9
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     if ($this->enableEditMode) {
         $formClass = $this->formClass;
         $activeForm = ActiveForm::classname();
         if (!is_subclass_of($formClass, $activeForm) && $formClass !== $activeForm) {
             throw new InvalidConfigException("Form class '{$formClass}' must exist and extend from '{$activeForm}'.");
         }
         $this->validateDisplay();
     }
     if ($this->bootstrap) {
         Html::addCssClass($this->options, 'table');
         if ($this->hover) {
             Html::addCssClass($this->options, 'table-hover');
         }
         if ($this->bordered) {
             Html::addCssClass($this->options, 'table-bordered');
         }
         if ($this->condensed) {
             Html::addCssClass($this->options, 'table-condensed');
         }
         $this->_childTableOptions = $this->options;
         if ($this->striped) {
             Html::addCssClass($this->options, 'table-striped');
         }
     }
     Html::addCssClass($this->_childTableOptions, 'kv-child-table');
     Html::addCssClass($this->options, 'detail-view');
     Html::addCssStyle($this->labelColOptions, "text-align:{$this->hAlign};vertical-align:{$this->vAlign};");
     parent::init();
     if (empty($this->container['id'])) {
         $this->container['id'] = $this->getId();
     }
     $this->initI18N(__DIR__);
     if ($this->enableEditMode) {
         $this->formOptions['fieldConfig']['template'] = "{input}\n{hint}\n{error}";
         $this->_form = $formClass::begin($this->formOptions);
     }
     Html::addCssClass($this->alertContainerOptions, 'panel-body kv-alert-container');
     $this->alertMessageSettings += ['kv-detail-error' => 'alert alert-danger', 'kv-detail-success' => 'alert alert-success', 'kv-detail-info' => 'alert alert-info', 'kv-detail-warning' => 'alert alert-warning'];
     $this->registerAssets();
 }
예제 #10
0
파일: PhotoTag.php 프로젝트: ivan-shu/x-tag
 public function init()
 {
     foreach ($this->attributes as $attribute) {
         static::validateAttribute($attribute);
     }
     Html::addCssClass($this->options, 'detail-view');
     $this->validateDisplay();
     if ($this->bootstrap) {
         Html::addCssClass($this->options, 'table');
         if ($this->hover) {
             Html::addCssClass($this->options, 'table-hover');
         }
         if ($this->bordered) {
             Html::addCssClass($this->options, 'table-bordered');
         }
         if ($this->striped) {
             Html::addCssClass($this->options, 'table-striped');
         }
         if ($this->condensed) {
             Html::addCssClass($this->options, 'table-condensed');
         }
     }
     Html::addCssStyle($this->labelColOptions, "text-align:{$this->hAlign};vertical-align:{$this->vAlign};");
     parent::init();
     if (empty($this->container['id'])) {
         $this->container['id'] = $this->getId();
     }
     $this->initI18N();
     $this->template = strtr($this->template, ['<th>' => Html::beginTag('th', $this->labelColOptions), '<td>' => Html::beginTag('td', $this->valueColOptions)]);
     Html::addCssClass($this->formOptions, 'kv-detail-view-form');
     $this->formOptions['fieldConfig']['template'] = "{input}\n{hint}\n{error}";
     $this->_form = ActiveForm::begin($this->formOptions);
     $this->registerAssets();
 }
예제 #11
0
 public function init()
 {
     parent::init();
 }