Wiki articles in category Tutorials

Showing 61-80 of 264 items.

Force a User to Change Their Password (ChangePasswordFilter)

Created 12 years ago by waterloomatt, updated 12 years ago by waterloomatt.

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.

14 0
10 followers
Viewed: 29 559 times
Version: 1.1
Category: Tutorials

How to work with flash messages

Created 15 years ago by pfth, updated 12 years ago by François Gannaz.

Set your messages in a controller:

Yii::app()->user->setFlash('success', "Data1 saved!");
Yii::app()->user->setFlash('error', "Data2 failed!");
Yii::app()->user->setFlash('notice', "Data3 ignored.");
51 0
40 followers
Viewed: 386 289 times
Version: 1.1
Category: Tutorials

Manage application configuration in different modes

Created 14 years ago by qiang, updated 12 years ago by 张 迪.

Application configuration determines how an Yii application should behave, because it is the only parameter passed in the entry script. An application, on the other hand, needs to behave differently under different circumstances. For example, an application may need different configurations when running in production mode, development mode and testing mode; In a team development environment, each...

15 0
15 followers
Viewed: 67 848 times
Version: 1.1
Category: Tutorials

How to use Flash, Zend AMF and Yii Framework

Created 12 years ago by janisto, updated 12 years ago by janisto.

This is a simple demo how to use Zend_AMF with Yii.

3 0
6 followers
Viewed: 15 807 times
Version: 1.1
Category: Tutorials

How to add a named scope to ActiveRecords with a behavior

Created 14 years ago by Mike, updated 12 years ago by yiqing95.

Since Yii 1.0.5 you can use named scopes with ActiveRecords. They are a great help in simplifying your query calls.

2 0
10 followers
Viewed: 35 060 times
Version: 1.1
Category: Tutorials
Tags:

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

Created 12 years ago by c@cba, updated 12 years ago by c@cba.

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 nam...

9 0
19 followers
Viewed: 49 690 times
Version: 1.1
Category: Tutorials

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

Created 12 years ago by c@cba, updated 12 years ago by c@cba.

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...

28 0
42 followers
Viewed: 75 872 times
Version: 1.1
Category: Tutorials

Multiple file upload handler

Created 12 years ago by hasanavi, updated 12 years ago by hasanavi.

Hi,

5 0
7 followers
Viewed: 33 170 times
Version: 1.1
Category: Tutorials

Setting application parameters dynamically in the back-end

Created 12 years ago by Pablovp, updated 12 years ago by Pablovp.

I was wondering how to set-up the application parameters in the back-end to use them all around the application without the need of using the database and I came up with this solution, I hope it helps somebody else.

12 0
16 followers
Viewed: 62 866 times
Version: 1.1
Category: Tutorials

Exporting CGridView results to CSV file

Created 12 years ago by RusAlex, updated 12 years ago by RusAlex.

A few days ago, i worked for CGridView exporting functional for my client. He asked me to create a simple exporting to a CSV file a CGridView search results.

6 3
18 followers
Viewed: 69 416 times
Version: 1.1
Category: Tutorials

Collaborative software with git

Created 12 years ago by sensorario, updated 12 years ago by Maurizio Domba Cerin.

The most difficult thing in a big project, is to manage conflicts with files modified by others users. Git can do this work for us.

9 0
9 followers
Viewed: 13 891 times
Version: 1.1
Category: Tutorials

Front-end developer's guide

Created 12 years ago by jonah, updated 12 years ago by waitekk.

This wiki is a work in progress.

10 0
19 followers
Viewed: 40 570 times
Version: 1.1
Category: Tutorials

CGridView: Use special variable $data in the htmlOptions of a column (i.e. evaluate htmlOptions attribute)

Created 12 years ago by c@cba, updated 12 years ago by c@cba.

    For each column of the CGridView, we can specify name, value, htmlOptions, cssClassExpression etc. In the declarations of the attributes value and cssClassExpression we can use the "special" variable $data, for example like this:
'value'=>'$data->author->username',.
    Now we might want to use $data in the declaration of the `...

19 1
14 followers
Viewed: 79 845 times
Version: 1.1
Category: Tutorials

config Use MS SQL SERVER 2005 2008.

Created 12 years ago by vcxz_1982, updated 12 years ago by Asgaroth.

Use SQL SERVER 2000, the date format not like: yyyy/mm/dd hh:mm:ss. So I change to use SQL SERVER 2008 EXPRESS.

3 0
8 followers
Viewed: 75 973 times
Version: 1.1
Category: Tutorials

Starting your Yii Project Reference Guide (with Git VCS in Linux)

Created 12 years ago by marcanuy, updated 12 years ago by marcanuy.

I've found useful to have a step by step reference guide to work with Git with most used commands, feel free to update it with useful information you may find interesting too.

16 0
12 followers
Viewed: 41 204 times
Version: 1.1
Category: Tutorials

How to log context information to logger (session id, user, ...)

Created 14 years ago by olafure, updated 11 years ago by ajsharma.

Logging context information (session, user, ...) to the logfile can be of great help tracking down problems with specific users.

2 0
5 followers
Viewed: 24 286 times
Version: 1.1
Category: Tutorials
Tags: Logging

Display an AJAX tree from your DB using CTreeView

Created 14 years ago by François Gannaz, updated 11 years ago by François Gannaz.

This example uses a MySQL DB with a table named tree with the fields id, name, and parent_id. The parent_id will be NULL for root elements. The SQL is kept simple (no autoinc, no FK, etc).

19 0
21 followers
Viewed: 72 010 times
Version: 1.1
Category: Tutorials

Deploy yii on pagoda box

Created 12 years ago by francis ja, updated 11 years ago by francis ja.

pagoda box is very useful tool for a programmer to test their php app online so its very useful one. For deploying code pagodabox use git command

4 0
5 followers
Viewed: 11 921 times
Version: 1.1
Category: Tutorials

Simple access control

Created 11 years ago by szfjozsef, updated 11 years ago by szfjozsef.

For those who feel, the Controller->accessRules() or RBAC (Role-Based Access Control) is too complicated or doesn't want the username(s) to be hard-coded in accessRules(), here is a very simple, easy-to-implement solution.

3 7
10 followers
Viewed: 46 096 times
Version: 1.1
Category: Tutorials

MVC primer and 5 minute form walkthrough

Created 11 years ago by rix.rix., updated 11 years ago by rix.rix..

This tutorial assumes some basic knowledge of Yii and a functional development environment.

8 0
6 followers
Viewed: 29 445 times
Version: 1.1
Category: Tutorials