Wiki

Articles in category "tutorials", sorted by viewsX
Displaying 11-20 of 249 result(s).

How to add more information to Yii::app()->user

Created 7 years ago by qiangTutorials2 comments – viewed 155,622 times – ( +31 ) – version 1.1
By default, the expression Yii::app()->user returns a CWebUser 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 property that stores the username of the current user.

Understanding "Assets"

Created 5 years ago by Steve FriedlTutorials12 comments – viewed 146,469 times – ( +57 ) – version 1.1
Many newcomers to Yii ask about the assets/ directory found under the webroot, and this article means to explain why it's there and how to work with it.

How to automate timestamps in ActiveRecord models

Created 7 years ago by dalipTutorials9 comments – viewed 136,440 times – ( +32 ) – version 1.1
There are many ways to automate the setting of timestamps in yii ActiveRecord models. Three are presented here:

Understanding Virtual Attributes and get/set methods

Created 5 years ago by Steve FriedlTutorials20 comments – viewed 128,942 times – ( +79 / -1 ) – version 1.1
When you define or extend a class, you can create class variables and methods in Yii just like you can in any other PHP system:

Add information to Yii::app()->user by extending CWebUser

Created 6 years ago by atrandafirTutorials11 comments – viewed 120,388 times – ( +35 ) – version 1.1
This little tutorial explains a way how you can retrieve more parameters from Yii::app()->user by adding a component that extends CWebUser and retrieves the user information from database table named User.

Behaviors & events

Created 6 years ago by pestaaTutorials10 comments – viewed 118,343 times – ( +52 ) – version 1.1
These features provide endless possibilities and unbelievable flexibility, but as current documentation does not give more than a few examples, it might be difficult to fully understand their internals and requirements.

Ajax form submiting in Yii

Created 3 years ago by sirin kTutorials8 comments – viewed 118,341 times – ( +13 / -5 ) – version 1.1
hi guys, Here I'm going to give you a working example of ajax form submiting in Yii.

Understanding Scenarios

Created 4 years ago by Luke JurgsTutorials12 comments – viewed 111,065 times – ( +31 ) – version 1.1
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.

CGridView, CListView and CActiveDataProvider

Created 3 years ago by softarkTutorials22 comments – viewed 108,985 times – ( +46 ) – version 1.1
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.

Organize directories for applications with front-end and back-end using WebApplicationEnd behavior

Created 6 years ago by andy_sTutorials27 comments – viewed 99,221 times – ( +35 ) – version 1.1
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.