Wiki articles

Showing 161-180 of 822 items.

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: 385 884 times
Version: 1.1
Category: Tutorials

How to insert a Simple Dialog Box

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

I build this simple PHP class (DialogBox.php at the bottom of this wiki) to help you in the dialog box usage on Yii applications. The goal is run any Yii actions into this dialog box and return the resulting value to the calling instance.

5 0
9 followers
Viewed: 39 529 times
Version: 1.1
Category: How-tos

Application-driven database with CDbMigration and an extended CActiveRecord

Created 12 years ago by Tudor Ilisoi, updated 12 years ago by Tudor Ilisoi.

This is an incipient implementation of application-driven database with Yii.

8 0
10 followers
Viewed: 16 370 times
Version: 1.1
Category: Others

How to re enable logging during unit testing

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

Some of you have experienced the need to log some information while doing unit testing, due to the fact that the information given in the summary is just not enough, to know why the test is actually failing. this article focuses on 2 ways to get you logs up and running again.

11 0
10 followers
Viewed: 25 413 times
Version: 1.1
Category: How-tos

Creating a parameterized LIKE query

Created 12 years ago by Steve Friedl, updated 12 years ago by Asgaroth.

It's common to see users wishing to make substring DB queries, using the % metacharacter used to match anything; in this FAQ we'll search the tbl_comments table from the blog tutorial hoping to find the text in $match in the content column

13 0
21 followers
Viewed: 143 402 times
Version: 1.1
Category: FAQs

Increasing AR performance in connections with Oracle

Created 13 years ago by Trejder, updated 12 years ago by igorsantos07.

Please, note. This article is entirely based on a work done by me colleague developer, who hasn't got account on this webpage and also hasn't got time for writing this article. I'm writing it for him. I will try to forward him any comments that may appear, but can't assure if/when he'll be able to answer. I'm far, far less experienced in Oracle therefore I won't probably be able to help myself.

1 0
15 followers
Viewed: 49 643 times
Version: 1.1
Category: How-tos

How to validate CSRF token with session

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

First of all, You must change component config to enable the default Yii CSRF validation.

21 0
27 followers
Viewed: 100 105 times
Version: 1.1
Category: How-tos
Tags: CSRF, session

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 650 times
Version: 1.1
Category: Tutorials

Yii Security-extended guide

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

This article is called extended guide is because there is already a security guide in the Yii tutorial security section. but that guide is not complete in the sense that it does not rise the developers' attention to some other commonly happening attacks: SQL injection and magic URL, which can be major vulnerabilities in you...

6 6
12 followers
Viewed: 30 537 times
Version: 1.1
Category: Tips

Using events with CAction classes

Created 12 years ago by Antonio Ramirez, updated 12 years ago by 张 迪.

As you know, events are used by:

9 0
9 followers
Viewed: 23 366 times
Version: 1.1
Category: Tips

CPhpAuthManager - how it works, and when to use it

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

It is actually mentioned in the documentation

1 2
6 followers
Viewed: 32 003 times
Version: 1.1
Category: How-tos

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 775 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: 34 980 times
Version: 1.1
Category: Tutorials
Tags:

Rendering a view file in a console application

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

When someone want to send formatted HTML mails from a console application she/he will probably come across the problem of rendering view files.

2 1
7 followers
Viewed: 19 805 times
Version: 1.1
Category: How-tos

Managing constants easily

Created 12 years ago by briiC.lv, updated 12 years ago by briiC.lv.

/*

    Get class constants by token.
    If you set constants with same prefix, like:
	MY_STATUS_1
	MY_STATUS_2
	MY_STATUS_3
4 0
7 followers
Viewed: 30 571 times
Version: 1.1
Category: Tips

How to ensure unicity to url

Created 12 years ago by zaccaria, updated 12 years ago by marcovtwout.

Many time for SEO porpouses is important that each page will have a unique address.

13 0
16 followers
Viewed: 23 609 times
Version: 1.1
Category: Tips
Tags: SEO, unique, URL

Use application on production/development environment without making changes

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

I like programing on my localhost, however it really bugged me to make changes to index.php & config files on my production server. After combining all available wiki articles on this topic and some trial and error this is what I use for my applications so I could just upload it to production server and it will work without any changes.

8 1
11 followers
Viewed: 76 698 times
Version: 1.1
Category: Tips

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 595 times
Version: 1.1
Category: Tutorials

Database driven Cmenu

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

This is a simple example that will give you a base for designing a database driven menu system that will use CMenu to be rendered.

12 0
17 followers
Viewed: 37 025 times
Version: 1.1
Category: How-tos

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 759 times
Version: 1.1
Category: Tutorials