Wiki articles

Showing 161-180 of 826 items.

How to work with flash messages

Created 17 years ago by pfth pfth, updated 14 years ago by François Gannaz 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: 402 076 times
Version: 1.1
Category: Tutorials

How to insert a Simple Dialog Box

Created 14 years ago by bluyell bluyell, updated 14 years ago by bluyell 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: 42 302 times
Version: 1.1
Category: How-tos

Application-driven database with CDbMigration and an extended CActiveRecord

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

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

8 0
10 followers
Viewed: 18 824 times
Version: 1.1
Category: Others

How to re enable logging during unit testing

Created 14 years ago by Asgaroth Asgaroth, updated 14 years ago by Asgaroth 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: 28 507 times
Version: 1.1
Category: How-tos

Creating a parameterized LIKE query

Created 15 years ago by Steve Friedl Steve Friedl, updated 14 years ago by Asgaroth 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: 150 592 times
Version: 1.1
Category: FAQs

Increasing AR performance in connections with Oracle

Created 15 years ago by Trejder Trejder, updated 14 years ago by igorsantos07 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: 60 751 times
Version: 1.1
Category: How-tos

How to validate CSRF token with session

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

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

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

Manage application configuration in different modes

Created 17 years ago by qiang qiang, updated 14 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: 74 593 times
Version: 1.1
Category: Tutorials

Yii Security-extended guide

Created 14 years ago by bingjie2680 bingjie2680, updated 14 years ago by bingjie2680 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: 36 251 times
Version: 1.1
Category: Tips

Using events with CAction classes

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

As you know, events are used by:

9 0
9 followers
Viewed: 26 831 times
Version: 1.1
Category: Tips

CPhpAuthManager - how it works, and when to use it

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

It is actually mentioned in the documentation

1 2
6 followers
Viewed: 36 368 times
Version: 1.1
Category: How-tos

How to use Flash, Zend AMF and Yii Framework

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

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

3 0
6 followers
Viewed: 18 238 times
Version: 1.1
Category: Tutorials

How to add a named scope to ActiveRecords with a behavior

Created 17 years ago by Mike Mike, updated 14 years ago by yiqing95 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: 40 312 times
Version: 1.1
Category: Tutorials
Tags:

Rendering a view file in a console application

Created 14 years ago by Tompi Tompi, updated 14 years ago by Tompi 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: 22 185 times
Version: 1.1
Category: How-tos

Managing constants easily

Created 14 years ago by briiC.lv briiC.lv, updated 14 years ago by briiC.lv 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: 34 739 times
Version: 1.1
Category: Tips

How to ensure unicity to url

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

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

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

Use application on production/development environment without making changes

Created 14 years ago by ifdattic ifdattic, updated 14 years ago by ifdattic 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: 80 636 times
Version: 1.1
Category: Tips

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

Created 14 years ago by c@cba c@cba, updated 14 years ago by c@cba 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: 54 331 times
Version: 1.1
Category: Tutorials

Database driven Cmenu

Created 14 years ago by twisted1919 twisted1919, updated 14 years ago by twisted1919 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: 38 919 times
Version: 1.1
Category: How-tos

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

Created 14 years ago by c@cba c@cba, updated 14 years ago by c@cba 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: 83 737 times
Version: 1.1
Category: Tutorials