Yii Code Generator

Hi,

I am new to Yii. I Have installed the framework and created my database, but I cant get to the code generator?

After I have installed the application, how do i get to the Code generator?

I thought that it might be in :

http: //localhost/yii-1.1.8/framework/gii/generators/model/ModelGenerator.php

but when I browse to that I get an error :

Fatal error: Class ‘CCodeGenerator’ not found in /Library/WebServer/Documents/yii-1.1.8/framework/gii/generators/model/ModelGenerator.php on line 4

Can anyone help please?

Have you read the definitive guide to Yii ?

Here is the part that you need now - http://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app#implementing-crud-operations

Hello all,

I configure yii framework, by default it provides site demo . If i make new fresh site how it possible…

i am trying to do but I face some error…

Please help me…

The installation guide? After tramping around for 2 hours I got the part I was looking for:

testdrive/index.php?r=gii

and what did I get?

Error 403

You are not allowed to access this page.

I installed on apache2 server, the command to create testdrive was wrong for a linux user. The information on how to setup for mySQL kind of sucked, and the lack of a straight forward INSTALL the CODE GENERATOR NOW on Linux with a Windows Client is not prime time. 10 minutes is all I should have had to spend to get the Error, NOT 2 hours reading code tracking down how to get it to work.

Where are the rights needed per directory listed? What group/user? Why the error on a directory the application created?

I have to wait to post, I can’t post the url of my error generating - more time wasted, life is short folks, catch a clue.

So I spent MORE time and found

if(!$this->allowIp(Yii::app()->request->userHostAddress) && $route!==‘default/error’)

			throw new CHttpException(403,"You are not allowed to access this page.");

in yi\framework\gii\GiiModule.php and commented it out then the login prompt appeared and I logged in.

Maybe you could change "403,"You are not allowed to access this page." to something like:

You are NOT on the machine where you installed YII, you are a fool, you must figure out ipFilter!!! Go search the wiki for ipfilters!!

I made it work by adding 10.1.18.* to the ipFilters array, I logged in, Started with the Controller Generator, it appeared to work, went to the Crud Generator and died, I’m clueless what Model Class is and I’m out of time again.

I’ll try again when I’ve got a few more hours to burn up, looks like a fine product but lacking a ‘lets teach the dummies’ guide.

Did you follow the instruction in your config file, i.e. uncomment the gii module? (remove the /* and */), and did you change the ‘password’ => ‘Enter Your Password Here’ to something more useful?

application/protected/config/main.php


	'modules'=>array(

		// uncomment the following to enable the Gii tool

		/* <-- remove

		'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'),

		),

		*/ <!-- remove

	),

Then try going to /index.php?r=gii again. You should see a single input field in which to put the password.

You have to give the write permission to apache user for controller, model, and views folders. Otherwise it’s better you can use code genarator from shell.