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: 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!


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

return 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(





But the error keeps occurring:

I did exactly as what is in 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!