Wiki

Articles in category "tutorials", sorted by date (updated)X
Displaying 161-170 of 228 result(s).

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

Updated 2 years ago by c@cbaTutorials35 comments – viewed 39,220 times – ( +29 ) – 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.

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

Updated 2 years ago by c@cbaTutorials10 comments – viewed 26,180 times – ( +15 ) – version 1.1
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 2 years ago by yiqing95Tutorials2 comments – viewed 15,148 times – ( +4 ) – version 1.1
Since Yii 1.0.5 you can use named scopes with ActiveRecords. They are a great help in simplifying your query calls.

How to use Flash, Zend AMF and Yii Framework

Updated 2 years ago by janistoTutorials0 comments – viewed 8,260 times – ( +3 ) – version 1.1
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 2 years ago by 张 迪Tutorials5 comments – viewed 29,401 times – ( +15 ) – version 1.1
Info: This tutorial references the idea presented in Jonah's excellent blog article.

How to work with flash messages

Updated 2 years ago by François GannazTutorials10 comments – viewed 155,966 times – ( +57 ) – version 1.1
Set your messages in a controller:

Force a User to Change Their Password (ChangePasswordFilter)

Updated 2 years ago by waterloomattTutorials2 comments – viewed 14,000 times – ( +16 / -2 ) – version 1.1
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 2 years ago by GOshaTutorials19 comments – viewed 87,034 times – ( +76 ) – 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:

Understanding Autoloading, Helper Classes and Helper Functions

Updated 2 years ago by GOshaTutorials4 comments – viewed 65,110 times – ( +29 ) – version 1.1
Many Yii users ask how to create helper classes and functions, and though there are numerous approaches spread out among the forum and wiki articles, this Tutorial tries to bring it all together in one place.

Understanding "Assets"

Updated 2 years ago by GOshaTutorials11 comments – viewed 109,763 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.