當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。