Wiki

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

How to work with flash messages

Created 4 years ago by pfthTutorials9 comments – viewed 88,744 times – ( +49 )
Set your messages in a controller:

Use shortcut functions to reduce typing

Created 4 years ago by qiangTutorials8 comments – viewed 27,983 times – ( +48 )
Because Yii intends to be integrated nicely with third-party libraries, it does not define any global functions. Everything in Yii needs to be addressed with full class name or object scopes. For example, to access the current user, we need to use Yii::app()->user; to access application parameters, we need Yii::app()->params['name']; and so on. While editors like textmate can help alleviate the problem of these lengthy typings, it is worthwhile to define global shortcut functions to some commonly used method calls. They will make the application code look cleaner.

Behaviors & events

Created 3 years ago by pestaaTutorials7 comments – viewed 51,204 times – ( +40 )
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.

Creating a dependent dropdown

Created 4 years ago by dalipTutorials22 comments – viewed 144,095 times – ( +88 / -3 )
Often you'll need a form with two dropdowns, and one dropdown's values will be dependent on the value of the other dropdown. Using Yii's built-in AJAX functionality you can create such a dropdown.
tags: AJAX

CSS Naming Conventions

Created 2 years ago by qiangTutorials4 comments – viewed 21,513 times – ( +35 )
In this article, we introduce a set of CSS naming conventions that we have applied in several big projects and achieved success. The goal of these naming conventions is to eliminate the possibility of naming conflicts, facilitate debugging and maintenance, and to simplify the naming process.

CGridView, CListView and CActiveDataProvider

Created 9 months ago by softarkTutorials11 comments – viewed 35,111 times – ( +30 )
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.

XUpload Workflow

Created 11 months ago by AsgarothTutorials18 comments – viewed 21,949 times – ( +28 )
This wiki describes a more complex workflow using the XUpload widget

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

Created 3 years ago by atrandafirTutorials9 comments – viewed 56,973 times – ( +27 )
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.

Implementing a User Level Access System

Created 2 years ago by Antonio RamirezTutorials10 comments – viewed 27,400 times – ( +27 )
I would like to provide you a quick tip on how to implement user level access to your Yii applications.

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

Created about a year ago by c@cbaTutorials35 comments – viewed 20,961 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.