Custom Code Generator (gii)

Hello, I’m trying to generate javascript code (.js), change the path where the files will be generated and include more fields in the form of the generator, as the project namespace for example, someone has an idea of ​​how best to do this?

I tried to create a new generator following these steps:http://www.yiiframework.com/doc/guide/1.1/en/topics.gii but could not finish, to access the page generator that created it, the 404 error occurs (the accessing index.php/gii/widget, occurs: Unable to resolve the request "gii/widget.").

Thank you!

Hi

you must add the path to your generator in the gii cofig




return array(

'modules'=>array(

 'gii'=>array(

  'class'=>'system.gii.GiiModule',

   'generatorPaths'=>array(

	'ext.mygii',//alias to your generator

   ),

  ),

));

then it should work

Thanks for the reply Gustavo, I left my config like this:


'modules' => array(

		# gerador de codigo

		'gii' => array(

			'class' => 'system.gii.GiiModule',

			'password' => 'password',

			'generatorPaths' => array(

                'ext.generatorapp'

            )

		),

	),

But the error keeps occurring:

I did exactly as what is in http://www.yiiframework.com/doc/guide/1.1/en/topics.gii was changed only where widget to generatorapp.

Thank you!

I got the problem that I was doing it in the folder within gii/framework instead of doing inside /protected, not even have to change the configuration file.

The question now is: How to generate javascript files instead of php and how to set the path where the file is created, not find much useful documentation related to it.

Thank you!

Solved!

http://www.yiiframework.com/forum/index.php?/topic/26476-personalizar-gerador-de-codigos-gii/page__p__127256__fromsearch__1#entry127256

Tk’s