How To Generate Code on Yii Framework

First of all, you need to prepare:

  • Yii framework files. You can download from the site
  • Apache.
  • PHP (5.1 or above).

Now we moving forward. The steps are:

  1. Extract yii and put it on folder to your web-accessible root directory. Then check the feature on http://localhost/yii/requirements/ which will be supported with yii on your system. On my computer looks like this:Yii 1
    Yii 2
  2. If you want to using other database, you need set the libs so yii can support the feature.
  3. Find yiic.bat file then edit the path of php.exe so it will appropriate with you system.
    Yii 3
  4. Create folder for the webapp on web-accessible root directory. For me, I created “myyiiapptest” folder.
  5. Go to command prompt then run command “yiic webapp <path of your folder>”
    Yii 4
  6. Using your browser, go to your webapp. For me, it will be http://localhost/myyiiapptestYii5
  7. Open main.php file on <yourwebappfolder>/protected/config. Uncomment the gii array then set the config.
  8. Go to http://localhost/myyiiapptest/index.php?r=gii. Insert your password.Yii 7
    Yii 8
  9.  Now you are ready to generate your code depend what you need.

Hope this article can help. Thanks 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s