当前位置: 首页>>代码示例>>PHP>>正文


PHP Model::init方法代码示例

本文整理汇总了PHP中yii\base\Model::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Model::init方法的具体用法?PHP Model::init怎么用?PHP Model::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\base\Model的用法示例。


在下文中一共展示了Model::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public function init()
 {
     parent::init();
     $this->emails = ['test@test.com', 'test2@test.com', 'test3@test.com'];
     $this->schedule = [['day' => '27.02.2015', 'user_id' => 31, 'priority' => 1, 'enable' => 1], ['day' => '27.02.2015', 'user_id' => 33, 'priority' => 2, 'enable' => 0]];
     $this->questions = [['question' => 'test1', 'answers' => [['right' => 0, 'answer' => 'test1'], ['right' => 1, 'answer' => 'test2']]]];
 }
开发者ID:unclead,项目名称:yii2-multiple-input,代码行数:7,代码来源:ExampleModel.php

示例2: init

 /**
  * @inheritdoc
  * 
  * Model MUST be provided on object creation.
  * 
  * @throws InvalidConfigException
  */
 public function init()
 {
     parent::init();
     if ($this->model === null) {
         throw new InvalidConfigException('Model must be provided on object creation');
     }
 }
开发者ID:jlorente,项目名称:yii2-enhanced-captcha,代码行数:14,代码来源:CaptchaControl.php

示例3: init

 public function init()
 {
     parent::init();
     foreach (Yii::$app->request->cookies->getValue('cart', []) as $item) {
         $this->add($item);
     }
 }
开发者ID:worstinme,项目名称:yii2-z-cart,代码行数:7,代码来源:Cart.php

示例4: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $settingsManager = Yii::$app->settings;
     $this->type = $settingsManager->get('cache.class');
     $this->expireTime = $settingsManager->get('cache.expireTime');
 }
开发者ID:VasileGabriel,项目名称:humhub,代码行数:10,代码来源:CacheSettingsForm.php

示例5: init

 /**
  * Initialization
  * Set default values
  * @return void
  */
 public function init()
 {
     parent::init();
     if ($this->item !== null) {
         $this->setAttributes(['name' => $this->item->name, 'description' => $this->item->description], false);
     }
 }
开发者ID:simple-yii2,项目名称:user,代码行数:12,代码来源:RbacForm.php

示例6: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (!$this->id) {
         $this->id = Inflector::slug($this->label);
     }
 }
开发者ID:dawei101,项目名称:yii2-admin-module,代码行数:10,代码来源:Item.php

示例7: init

 public function init()
 {
     parent::init();
     if (is_array($this->publication)) {
         $this->publication = new Publication($this->publication);
     }
 }
开发者ID:teknosuper,项目名称:yii2-sitemap,代码行数:7,代码来源:News.php

示例8: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (($object = $this->object) !== null) {
         $this->setAttributes($object->getAttributes(['title', 'alias']), false);
     }
 }
开发者ID:simple-yii2,项目名称:gallery,代码行数:10,代码来源:GallerySectionForm.php

示例9: init

 public function init()
 {
     parent::init();
     if (\Yii::$app->request->isAjax) {
         $this->setResponseFormatJson();
     }
 }
开发者ID:Liv1020,项目名称:cms,代码行数:7,代码来源:RequestResponse.php

示例10: init

 public function init()
 {
     parent::init();
     // Setting default values
     $this->welcome_popup_title = 'Welcome';
     $this->welcome_popup_content = 'Welcome content';
 }
开发者ID:vvkgpt48,项目名称:merchium-advanced-app,代码行数:7,代码来源:OptionsForm.php

示例11: init

 public function init()
 {
     $module = null;
     Module::validateConfig($module);
     $this->_settings = $module->loginSettings;
     parent::init();
 }
开发者ID:imagis,项目名称:yii2-user,代码行数:7,代码来源:LoginForm.php

示例12: init

 public function init()
 {
     parent::init();
     $this->year = date('Y');
     $this->operator = self::OPERATOR_ALL;
     $this->type = self::TYPE_OVERRUN;
 }
开发者ID:shubnikofff,项目名称:mobiles,代码行数:7,代码来源:ReportSearch.php

示例13: __construct

 public function __construct(array $properties = array())
 {
     parent::init();
     foreach ($properties as $key => $value) {
         $this->{$key} = $value;
     }
 }
开发者ID:tsyrya,项目名称:mybriop,代码行数:7,代码来源:RabotnikKomissii.php

示例14: init

 /**
  *
  */
 public function init()
 {
     parent::init();
     $this->timezone = (new DateTimeZone('Europe/Kaliningrad'))->getOffset(new \DateTime()) / 60;
     $this->version = \Yii::$app->version;
     $this->bundle = 'com.example.app';
 }
开发者ID:voodoo-mobile,项目名称:yii2-api,代码行数:10,代码来源:MetaModel.php

示例15: init

 public function init()
 {
     parent::init();
     $mm = \Yii::$app->mailmaster;
     $this->setListID(ArrayHelper::getValue($mm, 'forms.' . $this->formReplaceID . '.listID'));
     $this->setFormID(ArrayHelper::getValue($mm, 'forms.' . $this->formReplaceID . '.formID'));
 }
开发者ID:albertborsos,项目名称:yii2-mailmaster,代码行数:7,代码来源:MailMasterFormModel.php


注:本文中的yii\base\Model::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。