當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ActiveRecord::scenarios方法代碼示例

本文整理匯總了PHP中yii\db\ActiveRecord::scenarios方法的典型用法代碼示例。如果您正苦於以下問題:PHP ActiveRecord::scenarios方法的具體用法?PHP ActiveRecord::scenarios怎麽用?PHP ActiveRecord::scenarios使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yii\db\ActiveRecord的用法示例。


在下文中一共展示了ActiveRecord::scenarios方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: scenarios

 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios[self::SCENARIO_AUTHOR] = ['content'];
     $scenarios[self::SCENARIO_ADMIN] = ['invisible', 'content'];
     return $scenarios;
 }
開發者ID:feijilei,項目名稱:simpleforum,代碼行數:7,代碼來源:Comment.php

示例2: __construct

 /**
  * @param array $params
  * @throws \yii\base\InvalidParamException
  */
 public function __construct($params)
 {
     $this->scenario = 'search';
     parent::__construct($params);
     if ($this->model === null) {
         throw new InvalidParamException('Param "model" cannot be empty');
     }
     $this->rules = $this->model->rules();
     $this->scenarios = $this->model->scenarios();
     foreach ($this->safeAttributes() as $attribute) {
         $this->attributes[$attribute] = '';
     }
 }
開發者ID:tqsq2005,項目名稱:dotplant2,代碼行數:17,代碼來源:SearchModel.php

示例3: scenarios

 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios['checkpass'] = ['is_check'];
     $scenarios['checktop'] = ['is_top'];
     return $scenarios;
 }
開發者ID:hongqipiaoyang,項目名稱:houtai,代碼行數:7,代碼來源:BuffModel.php

示例4: scenarios

 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios['login'] = ['username', 'password', 'rememberMe', 'verifyCode'];
     $scenarios['editprofile'] = ['password', 'newPassword', 'verifyNewPassword'];
     return $scenarios;
 }
開發者ID:sxunt520,項目名稱:YIIDEV,代碼行數:7,代碼來源:User.php

示例5: scenarios

 /**
  * @return array
  */
 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios['readonly'] = [];
     $scenarios['search'] = ['type'];
     return $scenarios;
 }
開發者ID:yii2ApplicationCollect,項目名稱:dotplant2,代碼行數:10,代碼來源:Contragent.php

示例6: scenarios

 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios['update'] = ['model', 'rocznik', 'pojemnosc', 'cena', 'zdjecie1', 'miniatura', 'opis', 'zdjecie2', 'zdjecie3', 'zdjecie4', 'przebieg'];
     //Scenario Values Only Accepted
     return $scenarios;
 }
開發者ID:marcinmisiak,項目名稱:bmwcars,代碼行數:7,代碼來源:Samochod.php

示例7: scenarios

 /**
  * @return array
  */
 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios['readonly'] = [];
     $scenarios['search'] = ['first_name', 'middle_name', 'last_name', 'email', 'phone'];
     return $scenarios;
 }
開發者ID:tqsq2005,項目名稱:dotplant2,代碼行數:10,代碼來源:Customer.php

示例8: scenarios

 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios[self::SCENARIO_SUGGEST] = ['title', 'text', 'link'];
     $scenarios[self::SCENARIO_UPDATE] = ['title', 'text', 'link', 'status'];
     return $scenarios;
 }
開發者ID:nuclearman,項目名稱:yiifeed,代碼行數:7,代碼來源:News.php

示例9: scenarios

 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios[self::SCENARIO_PERSON] = ['status', 'activity', 'city_id', 'surName', 'firstName', 'lastName', 'number', 'skype', 'email', 'password'];
     $scenarios[self::SCENARIO_COMPANY] = ['status', 'activity', 'company', 'type_ownership', 'INN', 'city_id', 'address', 'surName', 'firstName', 'lastName', 'number', 'site', 'skype', 'email', 'password'];
     return $scenarios;
 }
開發者ID:Shumer596,項目名稱:site.loc,代碼行數:7,代碼來源:User.php

示例10: scenarios

 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios[self::SCENARIO_SIGN_IN] = ['email', 'password'];
     $scenarios[self::SCENARIO_SIGN_UP] = ['login', 'email', 'password'];
     return $scenarios;
 }
開發者ID:Sywooch,項目名稱:babydiary,代碼行數:7,代碼來源:User.php

示例11: scenarios

 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios['create'] = ['api', 'title', 'description', 'message', 'type', 'fb_friend', 'fbFriendName', 'screen_name', 'category', 'email', 'url', 'preview', 'fileName', 'file', 'accept', 'facebook_id', 'stream'];
     $scenarios['respond'] = ['api', 'fileName', 'file', 'accept'];
     return $scenarios;
 }
開發者ID:babagay,項目名稱:razzd,代碼行數:7,代碼來源:Razz.php

示例12: scenarios

 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios['newItem'] = $scenarios['default'];
     $scenarios['updateMenuItems'] = $scenarios['default'];
     return $scenarios;
 }
開發者ID:maddoger,項目名稱:yii2-cms-website,代碼行數:7,代碼來源:Menu.php

示例13: scenarios

 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios['changePassword'] = ['newPassword', 'newPasswordConfirm', 'currentPassword'];
     $scenarios['registration'] = ['newPassword', 'newPasswordConfirm'];
     return $scenarios;
 }
開發者ID:weison-tech,項目名稱:humhub,代碼行數:7,代碼來源:Password.php

示例14: scenarios

 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios['generate-original'] = ['patient_name', 'drug_name', 'amount_id', 'time_bit', 'meal_id', 'time_array'];
     $scenarios['generate'] = ['profile_name', 'amount_id', 'time_bit', 'meal_id', 'time_array'];
     return $scenarios;
 }
開發者ID:gearger,項目名稱:imagenizer,代碼行數:7,代碼來源:Main.php

示例15: scenarios

 public function scenarios()
 {
     $scenarios = parent::scenarios();
     $scenarios['typeOfAccont'] = ['user_id', 'account_type'];
     $scenarios['addressDetails'] = ['gender', 'user_name', 'name', 'sur_name', 'address', 'country', 'province', 'city', 'postcode', 'mobile_phone', 'landline', 'birthday', 'skype_id', 'website', 'how_find_staylance'];
     return $scenarios;
 }
開發者ID:Junaid-Farid,項目名稱:staylance-new,代碼行數:7,代碼來源:Travellers.php


注:本文中的yii\db\ActiveRecord::scenarios方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。