The CMenu class provides some useful features for generating menus in your web application.
The CMenu class provides some useful features for generating menus in your web application.
This is not actually Yii involved.
Sometimes writing views like
We are running one frontend running NGINX and several app servers running Apache2. There are several issues we have come across but right now I'll be documenting one of them. I'll be completing this article when I get more time.
When using CListView to display multiple views next to each other, we can use the $index variable inside the viewFile to achieve this. As far as i know there is no extension or out-of-the-box functionality for this, so we need to apply a little hack:
When you're filling up a form of a CActiveRecord (using CActiveForm for example), usually you'll construct your code so that in case of validation error you'll get back the form with the error displayed back to you, typically when CActiveForm.errorSummary() is used. This is how its done by Gii.
I guess this is a tip on how to execute some code before every action in a controller, because I will tell you how I did it and maybe you can use the idea in your project.
Changing the way a CGridView is rendered from the configuration file, or through behaviors specified at the moment it is used, is handy to extend a CGridView without creating tons of different classes for it. I am surprised that this is not in the default implementation, so I made my default CGridView implementation.
If you have two datepicker in one form and you want that a date of from date shold be minimum date of todate then put following code in Cjuidatepicker widget options array:
'onSelect'=>'js:function(selected) {
$("#HostelRoomStatusMaster_room_status_master_end_date").datepicker("option","minDate",selected);
}',
If you are about to create a graph, the best option i would suggest is the jqbargraph.
Backoffice Grid Views often list information like Posts for a blog while showing at the same time linked information like the User who wrote that post. For more efficiency, it is appropriate that the User is displayed as a link to the User detail page.
The article Fixing extensions without modifying their code reminded me of another patching technique that I used. My conviction and a hard look on the web had led me to an article [Redefine PHP class methods or class](http://stackoverflow.com/questions/137006/ph...
If you're working a lot with extensions you often stumble upon problems, when you want to include them into your custom web application, like hardcoded or absolute path aliases or classes extended from core application components, which implement addiditonal features.
The problem: If you type Yii::app()->user<ctrl+space> code completion didn't work. This solve it.
After Installing Yii Users and Rights to Newly Created Yii app we have to assign dynamic roles to a user at the time of user creation .
There are several ways to speedup slow unit tests which interact with database:
Sometimes new Yii guys face problem to manage dependent dropDownList using AJAX. I am going to discuss an easy solution about this issue.
I recently had to have a checkbox column in my grid view that supported the 'disabled' attribute. This was easy enough to do by extending the CCheckBoxColumn. However, I also wanted the checkbox to be selected when clicking on the table's row (supported via CGridView's selectableRows option). I discovered I had to tweak yiigridview.js so that it would not select disabled rows when clicking on it o...