Wiki

Sorted by ratingX
Displaying 51-60 of 777 result(s).

Create your own Validation Rule

Created 5 years ago by nickcvHow-tos13 comments – viewed 182,068 times – ( +76 / -3 ) – version 1.1
Some times the core validation rules provided by Yii won't satisfy all your needs, so you'll need to create your very own validation rule.

Creating a jQueryUI Sortable CGridView

Created 5 years ago by blindMoeHow-tos23 comments – viewed 39,707 times – ( +48 / -1 ) – version 1.1
I have had to do this a couple of times now so I figured I would share it with the community. I am going to keep this short because I really hope that you are familiar with jQueryUI's Sortable class before starting this tutorial.

How to automate timestamps in ActiveRecord models

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

SEO-conform Multilingual URLs + Language Selector Widget (i18n)

Created 4 years ago by c@cbaTutorials37 comments – viewed 56,341 times – ( +32 ) – version 1.1
You have a multilingual application, and you want the URL of a page to be different for different languages, to account for SEO. The URL for the contact page for example should look like http://something.com/en/contact in english, and http://something.com/de/contact in german. This tutorial describes how to make it happen. Note that currently selected language is always a part of the URL, and thus available to the application through $_GET. You don't have to use sessions variables to keep track of the language if you don't want to.

Single sign on across multiple subdomains

Created 5 years ago by ianarĂ©How-tos10 comments – viewed 42,267 times – ( +32 ) – version 1.1
This had me stumped for a while so I figured it would be nice to share here to avoid others the grief.

Yii for beginners 2

Created 3 years ago by rackyczTutorials2 comments – viewed 51,706 times – ( +32 ) – version 1.1
Hi :-) Is that you again? Welcome !! :-)

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

Created 7 years ago by qiangTutorials2 comments – viewed 162,432 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 Scenarios

Created 4 years ago by Luke JurgsTutorials12 comments – viewed 116,966 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.

Searching and Sorting by Count of Related Items in CGridView

Created 4 years ago by softarkHow-tos13 comments – viewed 42,239 times – ( +31 ) – version 1.1
Let's say we have two models and relation between them:

Code style

Created 5 years ago by zaccariaTips2 comments – viewed 16,874 times – ( +30 ) – version 1.1
Often, when writing widgets or editing Yii code, it is unclear whether or not the code is following the MVC pattern.
tags: mvc