If you want to add module based login to a site without using RBAC, please follow these guidelines.
If you want to add module based login to a site without using RBAC, please follow these guidelines.
Yii comes with a set of powerful classes for logging. If you have read the documentation about logging messages, you have noticed that we can actually decide which messages we wish to log. And this is exactly what we are going to do, using [CWebLogRoute](http://www.yiiframework.com/doc/api/1.1/CWebLog...
I've seen a lot of people asking about the logging facilities in Yii and thought I'd share a nice little class I wrote that provides near real-time logging.
This tutorial shows how to filter CListView items by AJAX, and it's compatible with disabled JavaScript users
In my case this has been done to filter users list
To get null
from database instead of empty strings you need to set up your DB connection as follows:
It's common to see users wishing to make substring DB queries, using the %
metacharacter used to match anything; in this FAQ we'll search the tbl_comments
table from the blog tutorial hoping to find the text in $match
in the content
column
Many time for SEO porpouses is important that each page will have a unique address.
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 `...
Here's a quick tip to dump the SQL for query.
[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.