Yii Framework Forum: Yii Code Generator - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii Code Generator How to access code generator Rate Topic: -----

#1 User is offline   Bobby_123 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 04-July 11

Posted 04 July 2011 - 10:31 AM

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?
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,359
  • Joined: 12-October 09
  • Location:Croatia

Posted 04 July 2011 - 11:04 AM

Have you read the definitive guide to Yii ?

Here is the part that you need now - http://www.yiiframew...crud-operations
Find more about me.... btw. Do you know your WAN IP?
0

#3 User is offline   shid 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 26-January 13

Posted 26 January 2013 - 11:16 AM

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...
0

#4 User is offline   headhhurts 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 04-February 13

Posted 04 February 2013 - 02:21 AM

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.
0

#5 User is offline   headhhurts 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 04-February 13

Posted 04 February 2013 - 12:35 PM

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.
0

#6 User is offline   Denit S. 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 15
  • Joined: 13-March 13
  • Location:Netherlands

Posted 14 March 2013 - 09:39 PM

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.
Here are some tunes for you to enjoy! listen, listen, listen.
0

#7 User is offline   CPzee 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 59
  • Joined: 11-November 11
  • Location:Sri Lanka

Posted 19 March 2013 - 06:47 AM

View Postheadhhurts, on 04 February 2013 - 02:21 AM, said:

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.



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.
Found anything useful???? Pls click +
Ubuntu 12.04--PHP 5.3.10(Yii v1.1.13)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users