Whatever reason, it turns out to be easy enough to add that feature to your application. :)
Whatever reason, it turns out to be easy enough to add that feature to your application. :)
When to use Active Record is a common question among developers, Yii and overall.
For each column of the CGridView, we can specify name
, value
, htmlOptions
, cssClassExpression
etc. In the declarations of the attributes value
and cssClassExpression
we can use the "special" variable $data
, for example like this: 'value'=>'$data->author->username',
.
Now we might want to use $data
in the declaration of the `...
[CMenu] offers great functionality and the ability to customize just about every aspect of the output. There are many times when I need to create a drop down menu or simply modify the look to make the designers happy. Because this seems to be a common task for me, I figured I would share my code to create a very simple drop down menu that other people could use.
My article Display the full record in a CJuiDialog uses ajax to view a record in dialog on clicking the 'view-icon'.
This is a simple example that will give you a base for designing a database driven menu system that will use CMenu to be rendered.
I was wondering how to set-up the application parameters in the back-end to use them all around the application without the need of using the database and I came up with this solution, I hope it helps somebody else.
This solution requires Yii 1.1.9 or above
A simple trick to get the localized version of a model field is to add this little method to your models.
Start studying the MVC pattern. You will understand the roles of the model, the view and the controller and know where goes each part of the code.
Create a folder where to place an Yii app under wordpress folder (mine is "yii')
The problem: If you type Yii::app()->user<ctrl+space> code completion didn't work. This solve it.
I was looking around wiki and found that was no approach as the one I did so I guessed this is worth to write.
in Yii versions previous to 1.1.9 exceptions was handled differently during ajax request and displayed by CApplication::displayException(). This way the exception message displayed on ajax requests could not be customized.
The message for the CGridView delete request with YII_DEBUG set to true l...
CFormatter is one of Yii's core components and used to format values displayed in widgets like CGridView or CDetailView. All classic formats like numbers, text, urls or datetime are supported but you may have to use a formatting rule that isn't built in. Let's say we want to display arrays of strings (like tags associated with a product model)...
Yii makes it really easy for all to use their already made objects that automate everything we do. It provides also great power of flexibility and styling but hey, we programmers tend to complicate our lives and push a little more the power of our tools.
Some of you have experienced the need to log some information while doing unit testing, due to the fact that the information given in the summary is just not enough, to know why the test is actually failing. this article focuses on 2 ways to get you logs up and running again.
This is the first real problem that I encountered using Yii, trying to make a Model input repeatable in the form, validate and save them.
Yii does not have an LDAP class itself, but its very easy to implement LDAP in the stock UserIdentity class.
Occasionally one wishes to set systemwide parameters for an application, such as a contact address for email, an application name, or setting an option that guides major behavior. Yii provides for setting of static parameters in the configuration file, and this article talks about how to do it conveniently.