There are cases that model validators should be depended by controller/action and you couldn't manipulate on the model class or using scenarios in easy way
There are cases that model validators should be depended by controller/action and you couldn't manipulate on the model class or using scenarios in easy way
This page assumes that you have installed Wampserver on your MS Windows computer.
The problem is not new: after setting some filters in a grid (typically in admin view), and gone to another page, returning in the grid's page I would like to find the filters with previous setting mantained.
The CMenu class provides some useful features for generating menus in your web application.
For a complete sample Nginx+PHP-FPM config, view this how-to: Nginx & PHP-FPM
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.
One of the common tasks the web application might be required to perform, especially the app using some kind of a CMS, is to save the history of data changes. Your client for sure will want the answer to this simple question - If I mess this up or delete by accident can we bring it back? Well, DB backup is one thing and quick recovery is another - let's talk about latter one.
Please join the party by adding your own favorite Yii programming errors. Be sure to leave at least a hint at the correction.
I like programing on my localhost, however it really bugged me to make changes to index.php & config files on my production server. After combining all available wiki articles on this topic and some trial and error this is what I use for my applications so I could just upload it to production server and it will work without any changes.
We probably have all used a virtual attribute (model function) to retrieve complex or related data for a CGridView column:
In this article I will show you how to implement a secure password hashing mechanism in your Yii projects using a bCrypt class.
As you know, the CDetailView widget displays details of a single model. If no formatting is specified, boolean values that are stored in the database as 0 and 1, are represented in the detail view as 0 and 1. If formatted as boolean, they are represented as 'No' and 'Yes'. We want to add i18n support, so that Yes and No appear in the current language.
This method was inspirated on the excellent text about different environments available at http://www.yiiframework.com/doc/cookbook/32/
Countries sometimes change their laws pertaining to time zones and daylight saving times. This means that GMT+2 can be a different local time this August compared to last August! It could even be a different date!
During development, it's often very handy to have SQL logging and profiling.
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 `...
The problem was that all my web applications ran normally on localhost, but on server the Greek characters (or any other no-english characters) displayed with problems.
This solution requires Yii 1.1.9 or above
In this article you will find Yii framework extensions enabling you to add various charts/print out buttons etc. to your webapp.