Thursday, April 11, 2013

Step By Step Setup YiiBoilerPlate


Yii Boilerplate Installation Guides:

1. Download YiiBoilerplate from https://github.com/clevertech/YiiBoilerplate

2. Map admin.domainname.com (or similar) to backend > www
   Map domainname.com (or similar) to frontend > www (if required)

3. Create database for app
   Create database for test with suffix _test (if required)

4. Add db details to common > config > params-local.php

5. Remove comments from db connections in console > config > main.php
   Remove comments from db connections and gii in backend > config > main.php
   Remove comments from db connections in frontend > config > main.php (if required)

6. Run the following command
   ./runpostdeploy local non-migrate
   ./yiic migrate

Yii Boilerplate Get Start:

** Please chmod 777 for the following file and folder
- yiic and runpostdeploy
- backend/views
- backend/controllers
- backend/models

1. Run the following command to create table in mysql
   ./yiic migrate create create_tablename

2. Goto folder console/migration/ and find the file to add in table stucture

3. Run the following command after edit migration file
   ./yiic migrate

4. Goto backend/config/main.php to uncomment Gii section and save the file

5. You can browse Gii with the following path and start work with your MVC
   http://xxx.dev/backend/www/gii/default/index

To Enable Gii

1. Goto backend/config/main.php

2. uncomment Gii

3. Add the following code in Gii section, else you will get error 403
   'ipFilters' => array('127.0.0.1', $_SERVER['REMOTE_ADDR']),

To Browse Gii

1. Goto http://yourdomain.com/backend/www/gii/model/


*********************  HAPPY CODING!! ******************