Please note that this article is a simple example and good security should be taken into account when we play with authentication systems.
Please note that this article is a simple example and good security should be taken into account when we play with authentication systems.
There are many ways to automate the setting of timestamps in yii ActiveRecord models. Three are presented here:
Previously there was described a way to build an application with front-end and back-end. I would like to continue this theme and suggest another way to organize directories using WebApplicationEnd behavior.
CGridView (or CListView) together with CActiveDataProvider is a very powerful combination of the built-in tools of Yii. But how do they work together to accomplish their fantastic functions? And what are you expected to do to use them and to customize their behaviors? This article explains the very basics of them.
Large applications are often divided into front-end and back-end (or even more ends) depending on the target user groups. The front-end should be used by common users, while the back-end mainly the administrators or staff members. The two ends usually have dramatically different appearance, even though they may share a lot of code underneath. In this tutorial, we describe a way of organizing direc...
First declare an attribute to store the file name in the model class (either a form model or an active record model).
Also declare a file
validation rule for this attribute to ensure a file is uploaded with specific extension name.
Scenarios are an extremely useful tool for separating validation tasks on any class you use derived from CModel. In this tutorial we will use CActiveRecord.
With yii you're able to create ajax requests and updates easily. But most times you always want to show a loading indicatior to your user.
Many desktop programmers are used to having dynamic forms, where clicking on a record in a parent sub-form, updates another sub-form with the child records. While having many levels of nested sub-forms in a single view might not be such a good idea for a web application, I thought doing it one level deep might be interesting and useful. But, instead of sub-forms I used CGridViews.
Many Yii users ask how to create helper classes and functions, and though there are numerous approaches spread out among the forum and wiki articles, this Tutorial tries to bring it all together in one place.
Sometimes we get lost trying to search by a HAS_MANY relation using CActiveRecord or CActiveDataProvider in Yii 1.1. This article is a series of drills that try to describe the practical techniques of searching by a HAS_MANY relation.
Hello ppl. Even though i have a small experience with yii I though of writing this to help people which want to do something similar.
If you need simple Role based access control without the long RBAC process then this article is just for you. Lets jump to the point.
By default, the expression Yii::app()->user returns a [CWebUser] [application component](http://www.yiiframework.com/doc/guide/basics.application#application-component) which represents the information that are closely related with the current user. Some information can be persistent throughout the current user session. For example, [CWebUser] already comes with a [name|CWebUser::name] property th...
A simple and effective way to keep track what your users are doing within your application is to log their activities related to database modifications. You can log whenever a record was inserted, changed or deleted, and also when and by which user this was done. For a [CActiveRecord] Model you could use a behavior for this purpose. This way you will be able to add log functionality to ActiveRecor...
For some applications it can be advantageous for administration reasons to allow site administrators to login as other users. This is sometimes called user impersonation or "becoming that user".
As seen in this post, Yii doesn't enforce how language is set and maintained within the session.
In this tutorial, we describe how to implement multiple layouts for action views in an application. As an example, we assume that the pages in our application will use three different layouts:
The Definitive Guide introduces the fundamentals of managing URLs in a Yii application. In this tutorial, we introduce a practical technique that can quickly turn your application into using search-engine-friendly URLs.