ewbarnard Posted January 27, 2014 Share Posted January 27, 2014 Larry, Concerning Chapter 4, Generating Code with Gii (p. 69ff): In the tip at the end of the chapter (p. 76), you mention ways to customize Gii. This would be a great place to mention the Giix extension which you do describe later in your book. I use giix exclusively, and am extremely pleased. I find that I'm often tweaking table schema during development, and giix allows me to regenerate the base model without touching the model code that I write. Another item worth mentioning with respect to Giix: Here are a couple of low-impact ways to override the base model functions. Example 1. To add to the base rules, without copying the entire set of rules: public function rules() { $rules = parent::rules(); $rules[] = array('filename', 'file', 'allowEmpty' => false, 'types' => 'csv', 'wrongType' => 'The load file must be .csv', ); return $rules; } With the above, you can regenerate the base model class with giix, and not have to re-edit your rules() method. Example 2. Tweak one of the attribute labels. Again, this allows you to tweak a single label without copying the entire attributeLabels() method, and therefore not having to edit anything if you re-generate the base model class: public function attributeLabels() { $labels = parent::attributeLabels(); $labels['filename'] = Yii::t('app', 'Load File'); return $labels; } Link to comment Share on other sites More sharing options...
Larry Posted January 29, 2014 Share Posted January 29, 2014 Thank you very much for sharing your thoughts and experiences. I really appreciate it. I'll considering making different changes or recommendations when I do a final pass through on th ebook. Link to comment Share on other sites More sharing options...
faraihuruba Posted February 11, 2014 Share Posted February 11, 2014 i am failing to access the Gii from this url : http://localhost/yii/index.php/site/index.php/gii i am running on apache i get ERROR 404 The system is unable to find the requested action "index.php". Link to comment Share on other sites More sharing options...
ewbarnard Posted February 11, 2014 Author Share Posted February 11, 2014 It looks like you have index.php in your url twice. You probably need localhost / yii / index.php / gii Hope that helps! i am failing to access the Gii from this url : http://localhost/yii/index.php/site/index.php/gii i am running on apache i get ERROR 404 The system is unable to find the requested action "index.php". 2 Link to comment Share on other sites More sharing options...
Recommended Posts