Php maker manual
![php maker manual php maker manual](https://phpmaker.dev/doc/images/mobilemenu.png)
You will see a list of files to be generated, as shown below. Controller Class: app\controllers\Countr圜ontroller.Search Model Class: app\models\CountrySearch.For the "country" example, fill out the resulting form as follows:
![php maker manual php maker manual](https://www.dhresource.com/0x0/f2/albu/g10/M00/65/78/rBVaWV6xGHmADOUZAAPVsTytzV8816.jpg)
To create CRUD functionality using Gii, select the "CRUD Generator" (by clicking the link on the Gii index page).
#Php maker manual code#
Generating CRUD Code ¶ĬRUD stands for Create, Read, Update, and Delete, representing the four common tasks taken with data on most Web sites. If you had an existing file, you'll also see a message indicating that it was overwritten with the newly generated code. If creating a new file, you can just click "Generate".Ī confirmation page indicating the code has been successfully generated. When overwriting an existing file, check the box next to "overwrite" and then click the "Generate" button. The diff button next to the file name to see the differences between the code to be generated When using Gii, if you have already created the same file and would be overwriting it, click You may click on the name of the class file to preview its content. You will see models/Country.php is listed in the resulting class file to be created. To use Gii to generate an Active Record class, select the "Model Generator" (by clicking the link on the Gii index page). 'allowedIPs' => // adjust this to your needs You can configure Gii to add the allowed IP addresses as follows, 'gii' => [
![php maker manual php maker manual](https://demo.dokumen.tips/img/380x512/reader024/reader/2021010116/55cf9348550346f57b9d37ef/r-1.jpg)
Note: If you are accessing Gii from a machine other than localhost, the access will be denied by defaultįor security purpose. You can now access Gii via the following URL: http: //hostname/index.php?r=gii Thanks to that line, your application is in development mode, and will have already enabled Gii, per the above configuration. defined( 'YII_ENV') or define( 'YII_ENV', 'dev') If you check the entry script web/index.php of your application, you willįind the following line, which essentially makes YII_ENV_DEV to be true. The application should include a module named gii, which is of class yii\gii\Module. The above configuration states that when in development environment, Depending upon how you created your application, you may find the following code is already provided in the config/web.php configuration file: $config = You can enable Giiīy configuring it in the modules property of the application.
#Php maker manual how to#
This section will describe how to use Gii to automatically generate code