Wiki

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

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

Created 7 years ago by qiangTutorials2 comments – viewed 162,700 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 152,688 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 141,127 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 135,210 times – ( +80 / -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:

Ajax form submiting in Yii

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

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

Created 6 years ago by atrandafirTutorials11 comments – viewed 123,742 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 7 years ago by pestaaTutorials10 comments – viewed 122,753 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 117,255 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 4 years ago by softarkTutorials22 comments – viewed 113,324 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 112,938 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.