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 159,971 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 150,380 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 139,320 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 132,553 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 122,461 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.

Ajax form submiting in Yii

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

Behaviors & events

Created 6 years ago by pestaaTutorials10 comments – viewed 121,000 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.

Understanding Scenarios

Created 4 years ago by Luke JurgsTutorials12 comments – viewed 114,645 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 111,545 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.

Filter & Sort by calculated/related fields in GridView Yii 2.0

Created 2 years ago by Kartik VTutorials23 comments – viewed 103,923 times – ( +56 / -4 ) – version 2.0
This wiki explains how to add calculated fields into your Yii Framework 2.0 gridview with filtering and sorting.