In my opinion, Gii of the Yii framework is a quick creator. Of course, it is of little significance for learning, but for those who already understand its principles and use it to develop, it is a good tool for rapid development. So as a main development tool for Gii, it is still used a lot.
##Using Gii (Recommended learning: yii tutorial)
Gii is Implemented as a module, it must be used in an existing Yii application. To use Gii, we first change the application's configuration as follows:return array( ...... 'modules'=>array( 'gii'=>array( 'class'=>'system.gii.GiiModule', 'password'=>'在这里填写密码', // 'ipFilters'=>array(...IP 列表...), // 'newFileMode'=>0666, // 'newDirMode'=>0777, ), ),);
'components'=>array( ...... 'urlManager'=>array( 'urlFormat'=>'path', 'rules'=>array( 'gii'=>'gii', 'gii/<controller:\w+>'=>'gii/<controller>', 'gii/<controller:\w+>/<action:\w+>'=>'gii/<controller>/<action>', ...已有的规则... ), ), )
The basic process of using a generator is as follows:
Enter the generator page; Fill in the input box for the specified code generation parameters. For example, to use Module Generator to create a new module, you need to specify the module ID;Click the Preview button to preview the code that will be generated. You will see a table listing the files that will be generated. You can click on any of the files to preview the code;Click the Generate button to generate these code files;View the code generation log.The above is the detailed content of Is yii framework gii used a lot?. For more information, please follow other related articles on the PHP Chinese website!