Wiki articles in category Tutorials

Showing 201-220 of 265 items.

How to add a named scope to ActiveRecords with a behavior

Created 16 years ago by Mike, updated 13 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: 37 242 times
Version: 1.1
Category: Tutorials
Tags:

How to use Flash, Zend AMF and Yii Framework

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

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

3 0
6 followers
Viewed: 16 720 times
Version: 1.1
Category: Tutorials

Manage application configuration in different modes

Created 16 years ago by qiang, updated 13 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: 70 794 times
Version: 1.1
Category: Tutorials

How to work with flash messages

Created 16 years ago by pfth, updated 13 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: 394 350 times
Version: 1.1
Category: Tutorials

Force a User to Change Their Password (ChangePasswordFilter)

Created 13 years ago by waterloomatt, updated 13 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: 31 034 times
Version: 1.1
Category: Tutorials

Understanding Virtual Attributes and get/set methods

Created 14 years ago by Steve Friedl, updated 13 years ago by GOsha.

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:

class Comment extends CActiveRecord {
    public $helperVariable;
    public function rules() { ... }
    ...
}

and then use them in the obvious way:

$var   = $model->helperVariable;
$rules = $model->rules();

This part everybody understa...

66 0
44 followers
Viewed: 208 625 times
Version: 1.1
Category: Tutorials

Understanding Autoloading, Helper Classes and Helper Functions

Created 14 years ago by Steve Friedl, updated 13 years ago by GOsha.

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.

22 0
26 followers
Viewed: 125 161 times
Version: 1.1
Category: Tutorials

Understanding "Assets"

Created 14 years ago by Steve Friedl, updated 13 years ago by GOsha.

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.

46 0
40 followers
Viewed: 212 973 times
Version: 1.1
Category: Tutorials

TDD with PHPUnit_Story and Yii

Created 13 years ago by sidewinder, updated 13 years ago by sidewinder.

Having said all of that, I want to add that the purpose of this article is not to convince anyone to write tests or design following TDD patterns. I'm not going to change the world to what I think is good. It's just about showing how to use some tools together with Yii Framework.

7 0
9 followers
Viewed: 25 498 times
Version: 1.1
Category: Tutorials

Autocomplete in console command

Created 13 years ago by Stamm, updated 13 years ago by Stamm.

Missed of autocomplete in bash console commands yii make me sad.

3 0
4 followers
Viewed: 16 499 times
Version: 1.1
Category: Tutorials

Functional Testing in Yii using Goutte and PHPUnit

Created 13 years ago by putera, updated 13 years ago by putera.

We will use Symfony 2 components for writing tests for Yii project, it's gonna be fun :).

6 0
17 followers
Viewed: 31 221 times
Version: 1.1
Category: Tutorials

How to hide index.php on nginx

Created 16 years ago by miles, updated 13 years ago by Darwin Wen.

For a complete sample Nginx+PHP-FPM config, view this how-to: Nginx & PHP-FPM

4 0
12 followers
Viewed: 98 527 times
Version: 1.1
Category: Tutorials
Tags: URL

Creating a database-driven hierarchical Structure combined with CMenu and superfish

Created 15 years ago by thyseus, updated 13 years ago by thyseus.

Note: Please also take a look at the newer EMenu extension. This works even better that the deprecated CDropDownMenu!

15 0
24 followers
Viewed: 65 998 times
Version: 1.1
Category: Tutorials
Tags: menu

Windows Web Development With AMPPS, NetBeans and XDebug

Created 13 years ago by morcen, updated 13 years ago by morcen.
  1. Operating system: Windows
4 0
6 followers
Viewed: 40 037 times
Version: 1.1
Category: Tutorials

free PHP IDE CodeLobster supports Yii framework

Created 13 years ago by clod, updated 13 years ago by clod.

This page is created to supply short directions and general tips for managing a Yii application in Codelobster PHP Edition.

5 0
1 follower
Viewed: 20 914 times
Version: 1.1
Category: Tutorials

Multilanguage web site controlling by get request and database allowed languages

Created 14 years ago by Igor Ivanovic, updated 13 years ago by rei.

First, you have to have create database table for default language and allowed languages.

CREATE TABLE IF NOT EXISTS `tbl_languages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `lang` varchar(2) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `flagpath` varchar(40) CHARACTER SET utf8 COLLATE utf8_unicode_...
5 0
12 followers
Viewed: 31 862 times
Version: 1.1
Category: Tutorials

Configuring CWebLogRoute for DB profiling

Created 13 years ago by Igor Ivanovic, updated 13 years ago by Igor Ivanovic.

require_once($yii); Yii::createWebApplication($config)->run();

2 0
6 followers
Viewed: 35 313 times
Version: 1.1
Category: Tutorials

Caching the config main.php

Created 13 years ago by dckurushin, updated 13 years ago by dckurushin.

The config first required In CApplication constructor

4 1
14 followers
Viewed: 24 176 times
Version: 1.1
Category: Tutorials

Avoiding duplicate script download when using CActiveForm on Ajax calls

Created 13 years ago by Antonio Ramirez, updated 13 years ago by Maurizio Domba Cerin.

The only thing required is simple, we just need to create a view that will be partially rendered by a call to a controller (using renderPartial) and make sure that we process output -setting to true the parameter on the function. Everything will work as expected but...

11 1
9 followers
Viewed: 27 916 times
Version: 1.1
Category: Tutorials

三步使用cronjobs自动化去执行Yii 控制台任务

Created 13 years ago by Darwin Wen, updated 13 years ago by Darwin Wen.

这篇文章将介绍使用Linux cronjobs去自动化执行Yii Console Application(控制台)任务,像每天晚上执行缓存清理,临时文件清理,发送邮件,网站备份等等,重复的工作都交给服务器后台去完成,Yii本身已经提供了强大的支持,我们所做的工作就很少,当使用yiic webapp 自动生成工程结构时,强大的Yii已经全部帮我们生成好,仅仅只需三步。

0 4
2 followers
Viewed: 29 117 times
Version: 1.1
Category: Tutorials