Example #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]);
         }
     }
 }
Example #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>.
             The controller class name should follow the CamelCase scheme with an uppercase first letter', '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>.', 'moduleID' => 'This is the ID of the module that the generated controller will belong to.
             If not set, it means the controller will belong to the application.', 'indexWidgetType' => 'This is the widget type to be used in the index page to display list of the models.
             You may choose either <code>GridView</code> or <code>ListView</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>.']);
 }
Example #3
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>.']);
 }
Example #4
0
 /**
  * @inheritdoc
  */
 public function hints()
 {
     return array_merge(parent::hints(), ['modelClass' => 'This is the model class for collecting the form input. You should provide a fully qualified class name, e.g., <code>app\\models\\Post</code>.', 'viewName' => 'This is the view name with respect to the view path. For example, <code>site/index</code> would generate a <code>site/index.php</code> view file under the view path.', 'viewPath' => 'This is the root view path to keep the generated view files. You may provide either a directory or a path alias, e.g., <code>@app/views</code>.', 'scenarioName' => 'This is the scenario to be used by the model when collecting the form input. If empty, the default scenario will be used.']);
 }