예제 #1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     $stickyAttributes = $this->model->stickyAttributes();
     if (in_array($this->attribute, $stickyAttributes)) {
         $this->sticky();
     }
     $hints = $this->model->hints();
     if (isset($hints[$this->attribute])) {
         $this->hint($hints[$this->attribute]);
     }
     $autoCompleteData = $this->model->autoCompleteData();
     if (isset($autoCompleteData[$this->attribute])) {
         if (is_callable($autoCompleteData[$this->attribute])) {
             $this->autoComplete(call_user_func($autoCompleteData[$this->attribute]));
         } else {
             $this->autoComplete($autoCompleteData[$this->attribute]);
         }
     }
 }
예제 #2
0
 /**
  * @inheritdoc
  */
 public function hints()
 {
     return array_merge(parent::hints(), ['modelClass' => 'This is the ActiveRecord class associated with the table that CRUD will be built upon.
             You should provide a fully qualified class name, e.g., <code>app\\models\\Post</code>.', 'controllerClass' => 'This is the name of the controller class to be generated. You should
             provide a fully qualified namespaced class (e.g. <code>app\\controllers\\PostController</code>),
             and class name should be in CamelCase with an uppercase first letter. Make sure the class
             is using the same namespace as specified by your application\'s controllerNamespace property.', 'viewPath' => 'Specify the directory for storing the view scripts for the controller. You may use path alias here, e.g.,
             <code>/var/www/basic/controllers/views/post</code>, <code>@app/views/post</code>. If not set, it will default
             to <code>@app/views/ControllerID</code>', 'baseControllerClass' => 'This is the class that the new CRUD controller class will extend from.
             You should provide a fully qualified class name, e.g., <code>yii\\web\\Controller</code>.', 'searchModelClass' => 'This is the name of the search model class to be generated. You should provide a fully
             qualified namespaced class name, e.g., <code>app\\models\\PostSearch</code>.']);
 }
예제 #3
0
 /**
  * @inheritdoc
  */
 public function hints()
 {
     return array_merge(parent::hints(), ['migrationPath' => 'Path to store generated file, e.g., <code>@app/migrations</code>', 'db' => 'This is the ID of the DB application component.', 'tableName' => 'This is the name of the DB table that the new ActiveRecord class is associated with, e.g. <code>post</code>.
             The table name may consist of the DB schema part if needed, e.g. <code>public.post</code>.
             The table name may end with asterisk to match multiple table names, e.g. <code>tbl_*</code>
             will match tables who name starts with <code>tbl_</code>.', 'migrationName' => 'The name of the new migration. This should only contain letters, digits and/or underscores.', 'migrationTime' => 'Time of the new migration. This should only has format <code>yymmdd_hhiiss</code>.', 'generateRelations' => 'This indicates whether the generator should generate relations based on
             foreign key constraints it detects in the database. Note that if your database contains too many tables,
             you may want to uncheck this option to accelerate the code generation process.', 'useTablePrefix' => 'This indicates whether the table name returned by the generated migration
             should consider the <code>tablePrefix</code> setting of the DB connection. For example, if the
             table name is <code>tbl_post</code> and <code>tablePrefix=tbl_</code>, the migration
             will use the table name as <code>{{%post}}</code>.']);
 }
예제 #4
0
 /**
  * @inheritdoc
  */
 public function hints()
 {
     return array_merge(parent::hints(), ['ns' => 'This is the namespace of the ActiveRecord class to be generated, e.g., <code>app\\models</code>', 'db' => 'This is the ID of the DB application component.', 'tableName' => 'This is the name of the DB table that the new ActiveRecord class is associated with, e.g. <code>post</code>.
             The table name may consist of the DB schema part if needed, e.g. <code>public.post</code>.
             The table name may end with asterisk to match multiple table names, e.g. <code>tbl_*</code>
             will match tables who name starts with <code>tbl_</code>. In this case, multiple ActiveRecord classes
             will be generated, one for each matching table name; and the class names will be generated from
             the matching characters. For example, table <code>tbl_post</code> will generate <code>Post</code>
             class.', 'modelClass' => 'This is the name of the ActiveRecord class to be generated. The class name should not contain
             the namespace part as it is specified in "Namespace". You do not need to specify the class name
             if "Table Name" ends with asterisk, in which case multiple ActiveRecord classes will be generated.', 'baseClass' => 'This is the base class of the new ActiveRecord class. It should be a fully qualified namespaced class name.', 'generateRelations' => 'This indicates whether the generator should generate relations based on
             foreign key constraints it detects in the database. Note that if your database contains too many tables,
             you may want to uncheck this option to accelerate the code generation process.', 'generateLabelsFromComments' => 'This indicates whether the generator should generate attribute labels
             by using the comments of the corresponding DB columns.', 'useTablePrefix' => 'This indicates whether the table name returned by the generated ActiveRecord class
             should consider the <code>tablePrefix</code> setting of the DB connection. For example, if the
             table name is <code>tbl_post</code> and <code>tablePrefix=tbl_</code>, the ActiveRecord class
             will return the table name as <code>{{%post}}</code>.', 'useSchemaName' => 'This indicates whether to include the schema name in the ActiveRecord class
             when it\'s auto generated. Only non default schema would be used.', 'generateQuery' => 'This indicates whether to generate ActiveQuery for the ActiveRecord class.', 'queryNs' => 'This is the namespace of the ActiveQuery class to be generated, e.g., <code>app\\models</code>', 'queryClass' => 'This is the name of the ActiveQuery class to be generated. The class name should not contain
             the namespace part as it is specified in "ActiveQuery Namespace". You do not need to specify the class name
             if "Table Name" ends with asterisk, in which case multiple ActiveQuery classes will be generated.', 'queryBaseClass' => 'This is the base class of the new ActiveQuery class. It should be a fully qualified namespaced class name.']);
 }