Wiki articles

Showing 161-180 of 650 items.

Manage application configuration in different modes

Created 10 years ago by qiang, updated 7 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: 43 499 times
Version: 1.1
Category: Tutorials

Yii Security-extended guide

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

Using events with CAction classes

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

As you know, events are used by:

9 0
9 followers
Viewed: 18 734 times
Version: 1.1
Category: Tips

CPhpAuthManager - how it works, and when to use it

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

It is actually mentioned in the documentation

1 2
6 followers
Viewed: 26 624 times
Version: 1.1
Category: How-tos

How to use Flash, Zend AMF and Yii Framework

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

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

3 0
6 followers
Viewed: 13 199 times
Version: 1.1
Category: Tutorials

How to add a named scope to ActiveRecords with a behavior

Created 10 years ago by Mike, updated 7 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: 27 194 times
Version: 1.1
Category: Tutorials
Tags:

Rendering a view file in a console application

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

Managing constants easily

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

How to ensure unicity to url

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

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

13 0
17 followers
Viewed: 17 231 times
Version: 1.1
Category: Tips
Tags: SEO, unique, URL

Use application on production/development environment without making changes

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

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

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

Database driven Cmenu

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

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

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

Troubleshooting Rights Extension

Created 7 years ago by junxiong, updated 7 years ago by junxiong.

Rights is one of user interface for Yii's Role Base Access Control extension. It is one of most downloaded extensions in Yii's Web.

5 0
14 followers
Viewed: 26 862 times
Version: 1.1
Category: Tips

Tarpit for bad bots

Created 7 years ago by mithereal, updated 7 years ago by mithereal.

I recently built a tarpit for bad bots.

1 0
9 followers
Viewed: 8 358 times
Version: 1.1
Category: How-tos
Tags: bots, tarpit

How to handle decimal separators (e.g comma instead of dot) for l18n

Created 7 years ago by jpablo, updated 7 years ago by jpablo.

Yii i18n does not cover decimal format. Some languages like Spanish (I live in Argentina) uses comma ',' instead of dot '.' as decimal separator.

2 0
10 followers
Viewed: 18 785 times
Version: 1.1
Category: How-tos
Tags:

Multiple file upload handler

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

Hi,

5 0
7 followers
Viewed: 28 346 times
Version: 1.1
Category: Tutorials

X-Sendfile - serve large static files efficiently from web applications

Created 8 years ago by Maurizio Domba Cerin, updated 7 years ago by Maurizio Domba Cerin.

Normally when we want users to download a file, that file is put in a folder under the web application root and the web server does the rest.

29 0
20 followers
Viewed: 81 596 times
Version: 1.1
Category: How-tos

Setting application parameters dynamically in the back-end

Created 7 years ago by Pablovp, updated 7 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.

11 0
15 followers
Viewed: 48 544 times
Version: 1.1
Category: Tutorials

How to obtain a grammatically correct translation of the model name in giix-generated view files

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

The giix code generator has out of the box i18n support for model names and attribute labels (besides other cool features > check it out!) .
But I want to factor in not only the plural form, but also the grammatical cases (especially the accusative) while translating 'Manage Objects', 'Create Object', 'Edit Object' etc.

4 0
1 follower
Viewed: 14 345 times
Version: 1.1
Category: How-tos