Wiki

Articles in category "tutorials", sorted by date (updated)X
Displaying 101-110 of 172 result(s).

How to use ldap in UserIdentity for authentication

Updated about a year ago by NavarrTutorials10 comments – viewed 20,168 times – ( +11 )
Yii does not have an LDAP class itself, but its very easy to implement LDAP in the stock UserIdentity class.

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

Updated about a year ago by c@cbaTutorials35 comments – viewed 19,735 times – ( +26 )
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.

Manage (Target) Language in Multilingual Applications + A Language Selector Widget (i18n)

Updated about a year ago by c@cbaTutorials9 comments – viewed 14,594 times – ( +9 )
In case of a multilingual application, one might consider it a reasonable approach to store the preferred language of the user in a session variable, and after that, every time a page is requested, to check this session variable and render the page in the indicated language. This tutorial shows a Yii-way of doing this. We implement an event handler for the onBeginRequest event; as the name of the event suggests, this event handler will be called at the beginning of each request, so its a good place to check whether a language is provided (via post, session or cookie) and set the application language accordingly. We also implement a simple Language-Selector Widget, which can render the language options as ajax-links or as a drop-down list.

How to add a named scope to ActiveRecords with a behavior

Updated about a year ago by yiqing95Tutorials1 comment – viewed 9,478 times – ( +3 )
Since Yii 1.0.5 you can use named scopes with ActiveRecords. They are a great help in simplifying your query calls.

Searching and sorting by related model in CGridView

Updated about a year ago by redguyTutorials49 comments – viewed 59,224 times – ( +77 )
Lets say we have two models and relation between them:

How to use Flash, Zend AMF and Yii Framework

Updated about a year ago by janistoTutorials0 comments – viewed 6,228 times – ( +3 )
This is a simple demo how to use Zend_AMF with Yii.
tags: flash, zend, Zend_AMF, AMF

Manage application configuration in different modes

Updated about a year ago by 张 迪Tutorials4 comments – viewed 20,898 times – ( +14 )
Info: This tutorial references the idea presented in Jonah's excellent blog article.

How to work with flash messages

Updated about a year ago by François GannazTutorials9 comments – viewed 83,794 times – ( +48 )
Set your messages in a controller:

Force a User to Change Their Password (ChangePasswordFilter)

Updated about a year ago by waterloomattTutorials1 comment – viewed 8,644 times – ( +14 )
Sometimes you need to force a user to change their password after x number of days. This article describes how to implement this using a filter, ChangePasswordFilter.

Understanding Virtual Attributes and get/set methods

Updated about a year ago by GOshaTutorials16 comments – viewed 46,286 times – ( +64 )
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: