Gii – Error 404 Unable to find the code you requested.

Hi folks,

I encounter this bug today and like to share the solution. I notice that I have 3 red js errors saying ‘missing jquery library’. Then I remember that I explicitly tell Yii do not use built-in jquery library as in this post how-to-use-your-own-jquery-library-in-yii/

I do not know how to include jquery library for Gii use. Therefore, I have to comment out the clientScript in config/main.php and the problem solved. I have to put it back after finishing Gii business. If you know another way to do it, please let me know.


		'clientScript'=>array(
			'class' => 'CClientScript',
			'scriptMap' => array(
				'jquery.js'=>false,
				'jquery-ui.min.js'=>false,
			),
			'coreScriptPosition' => CClientScript::POS_BEGIN,
		), 

On the side note, SJFred has great article on Gii 403 error @ http://www.yiiframework.com/wiki/115/why-do-i-get-a-403-error-when-trying-to-use-gii/

One response to “Gii – Error 404 Unable to find the code you requested.

  1. Ha! You legend you saved me so much time, re-jogging my memory I had done a few comments earlier in time to strip out an old version of jquery in framework\web\js\packages.php. I’d been messing with some jquery calendar’s earlier and forgot to remove the comments! Thanks for the MA_HA-ASSIVE time saver! 🙂

Leave a comment