Jonathon Posted April 3, 2013 Share Posted April 3, 2013 Hi Larry, I was wondering if (When you get a spare minute). If you could let me know your experiences with the Giix extension. I read about it in your book and it seemed really helpful. However this is the first time i've used Yii so I wondered if any changes it creates in comparison to regular Gii might be hard to pick up for someone new to Yii like me, some of the methods seem to change to things like "GxActiveForm" for instance. I liked what you and it has to say about better handling of related tables as I do have a lot on related tables. And from reading between the lines it seems that if you make changes to your DB after you start it would be easier to update the code. Thanks Jonathon Link to comment Share on other sites More sharing options...
Larry Posted April 3, 2013 Share Posted April 3, 2013 Hey Jonathon, I'm not sure I have too much to add beyond what I say in the book. I like much of what Giix does, especially for beginners and especially with relations. I also like the approach it puts forth: customizing the Gii-generated code to suit the way you want things done. It's fantastic that Yii (Gii) creates all the code for you, but you don't have to just accept that code as it is, either. Link to comment Share on other sites More sharing options...
Jonathon Posted April 3, 2013 Author Share Posted April 3, 2013 Thanks Larry, I'll have a play with it, see how I get on! Jonathon Link to comment Share on other sites More sharing options...
Jonathon Posted April 6, 2013 Author Share Posted April 6, 2013 I'm having a look at the Giix extension. I just made another copy of my practice site and renamed it. I notice the code is very similar in places. Just wanted to check over a couple of things. I notice it doesn't list a postOnly + delete in the filter, but in the actionDelete code it states public function actionDelete($id) { if (Yii::app()->getRequest()->getIsPostRequest()) { $this->loadModel($id, 'Item')->delete(); if (!Yii::app()->getRequest()->getIsAjaxRequest()) $this->redirect(array('admin')); } else throw new CHttpException(400, Yii::t('app', 'Your request is invalid.')); } Does if (Yii::app()->getRequest()->getIsPostRequest()). Basically mean the same as the filter. It would appear so. Also noted that in the Giix version of a controller it uses the $model->setAttributes=$_POST['Item']; where as the standard Gii method uses $model->attributes=$_POST['Item'];. I wondered why the slight difference. I looked at the framework notes for this but couldn't really understand the difference in the two methods. Other than the setAttributes method does seem to clearly defined as a setter. Other than that the controllers are very similar for those interested. I shall have to have a play with using data and related tables. Jonathon Link to comment Share on other sites More sharing options...
ewbarnard Posted January 24, 2014 Share Posted January 24, 2014 I have been using the giix extension for a couple of months now. I have been making a lot of table schema changes during development, and the fact that giix splits the model into a base part and a localized part is extremely helpful. When the model changes, such as adding a foreign key pointing to that table, rebuild the base model without touching your code. Be VERY careful when re-generating model or CRUD code! Be sure you preview everything, item by item, to ensure you don't overwrite something you meant to keep. In the views, I often copy-and-paste from the "diff" preview into my existing edited file to pick up the new or changed field/relationship. Ed Barnard Link to comment Share on other sites More sharing options...
Larry Posted January 29, 2014 Share Posted January 29, 2014 Thanks again for sharing, Ed. Version control will help in these situations, of course, or just copying the existing directory somewhere else before making changes. Link to comment Share on other sites More sharing options...
ewbarnard Posted January 31, 2014 Share Posted January 31, 2014 To repeat what Larry said: It's a REALLY good idea to make a copy of your current source code before you fire up the code generator to re-generate some of your code! Link to comment Share on other sites More sharing options...
melaniecarr23 Posted May 12, 2016 Share Posted May 12, 2016 Okay I'm still going through the book and I LOVED the Booster plugin but I don't get the Giix plugin at all. I installed it and ran the giix model and giix crud for tables that are related but the code generated for my one model doesn't even show the admin page. It's just a blank white screen! I look for documentation on how to use the features of this extension and there isn't any! Just issues. What am I missing. I can't see supporting an extension that doesn't help you figure out what you can do with it. MANY_MANY relationships with lookup tables are my freaking nemesis. I can't figure out how to use Yii to work with them easily. Link to comment Share on other sites More sharing options...
Larry Posted May 17, 2016 Share Posted May 17, 2016 Just to be clear, you're using a Yii2 version of Giix? Could you confirm the Yii version and where you downloaded Giix from? Also, is display_errors enabled or are you seeing errors in your server logs? Link to comment Share on other sites More sharing options...
melaniecarr23 Posted May 18, 2016 Share Posted May 18, 2016 I don't know what I did to mess it up, but I got this working. Link to comment Share on other sites More sharing options...
Larry Posted May 18, 2016 Share Posted May 18, 2016 That does happen! Thanks for letting us know. Link to comment Share on other sites More sharing options...
Recommended Posts