Go [[step_1_-_setup_database|back]]\\

Go in **Gii**. You can modify the example below
<code>
http://hostname/index.php?r=gii
</code>
or with "Pretty URLs" enabled
<code>
http://hostname/gii
</code>

Now go to the ''Model Generator'' and click ''Start''\\
If you have the example ''guitars'' table installed from [[a_simple_migration_example|here]]\\
then put ''guitars'' in **Table Name**\\
 ''Guitars'' in **Model Class Name**\\
**Namespace** should be ''app\models''\\
Click on ''Preview'' then ''Generate''\\
This will generate the ''Guitars.php'' file in the ''models'' folder.\\

Now click on the ''Start'' button under the ''CRUD Generator'' or go the ''CRUD Generator'' left menu item.\\
Under **Model Class** put in ''app\models\Guitars''\\
In **Search Model Class** put ''app\models\GuitarsSearch''\\
In **Controller Class** put ''app\controllers\GuitarsController''\\
In **View Path** put ''@app/views/guitars''\\

Then click '' Preview '' then '' Generate ''\\
You'll find a ''GuitarsController.php'' in the ''controllers'' folder\\
and a ''GuitarsSearch.php'' in the ''models'' folder.\\

Plus the ''Views'' folder will have a ''guitars'' folder with the CRUD files.\\
Going to ''http://localhost/guitars'' will then give access to all the CRUD functions\\

Lets now move to putting up a user system. Click [[step_3_-_install_amnah_yii2_user|here]]  

Back to [[yii|Yii Main Index]]

