Search

Content

How to Install and work with Yii 1.0 Frame work for php 7/22/2015
1. Download yii application stable version I have download 1.0 from yii website.Link
            

2.Extract it. And  go to path
    cd YiiPath\framework

3. Replace "php.exe" with "path to your php.exe file" in "yii\framework\yiic.bat"
Example:  "D:\wamp\bin\php\php5.3.10\php.exe" in "yii\framework\yiic.bat"


4.Open cmd and go to "yii/framework" using cd command.After that create  application using below command.

         "yiic webapp ..\Project_Name"

5.Our project is created sucessfully. Now acess url  "http://localhost/Project_Name" .



6.Enabling and using curd commands.
    to use gii--> got to "protected/config/main.php" and un-comment
            /*
            'gii'=>array(
                'class'=>'system.gii.GiiModule',
                'password'=>'Enter Your Password Here',
                // If removed, Gii defaults to localhost only. Edit carefully to taste.
                'ipFilters'=>array('127.0.0.1','::1'),
            ),
            */

7. Edit the password of ur choise
        -->  'password'=>'some_secrect',

8. Acess url->"http://localhost/Project_Name/index.php?r=gii"  and enter password.

9. Enebling mysql service
    to use mysql--> got to "protected/config/database.php" edit as below
            <?php
            // This is the database connection configuration.
            return array(
                //'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
                // uncomment the following lines to use a MySQL database
               
                'connectionString' => 'mysql:host=localhost;dbname=rtdada',
                'emulatePrepare' => true,
                'username' => 'root',
                'password' => '',
                'charset' => 'utf8',
               
            );

10. Activating URL style "controller/action".
    to use URL--> got to "protected/config/main.php" un-comment the following code

        /*
        'urlManager'=>array(
            'urlFormat'=>'path',
            'rules'=>array(
                '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
            ),
        ),
        */