Showing 1-20 of 292 items.

How to set up Unicode

Created 17 years ago by Mike Mike, updated 13 years ago by Roman Solomatin Roman Solomatin. 10 comments

To fix issues with display of special language characters once and for all there's a solution: use Unicode UTF-8 everywhere. If everything is set up to use Unicode, you can use mostly every language in your application.

19 0
14
Viewed: 153 423 times
Version: 1.1
Category: How-tos

Reference: Model rules validation

Created 16 years ago by krillzip krillzip, updated 12 years ago by Rodrigo Rodrigo. 7 comments

This is a reference to be used for Model rule validation and is compiled from the Yii documentation and code. The purpose is to have all the information gathered in one place instead of scattered. This reference is not an intro. See The Definitive Guide to Yii, Declaring Validation Rules for a tutorial.

99 0
114
Viewed: 923 669 times
Version: 1.1
Category: How-tos

How to use PHPExcel external library with Yii

Created 15 years ago by Antonio Ramirez Antonio Ramirez, updated 13 years ago by cgsmith cgsmith. 15 comments

Trying to learn and help some other programmers to find their solutions on the Yii Forum (I think is a superb way to learn the framework), I was facing one challenge with an external library that a fellow programmer wanted to use -quite good indeed: PHPExcel. And what is PHPExcel?

27 1
25
Viewed: 150 508 times
Version: 1.1
Category: How-tos

Using CButtonColumn to customize buttons in CGridView

Created 15 years ago by Trejder Trejder, updated 13 years ago by Gismo Gismo. 20 comments

The easiest way to customize look and behaviour of them is to use series of CButtonColumn properties, like: updateButtonImageUrl (path to image for update button), updateButtonLabel (label for the update button; not HTML-encoded), updateButtonOptions (HTML options for this button, used in the way as many htmlOptions property for many widgets) and updateButtonUrl (a PHP expresion th...

75 0
59
Viewed: 359 972 times
Version: 1.1
Category: How-tos

Changing Controllers Name

Created 15 years ago by Trejder Trejder, updated 13 years ago by Trejder Trejder. 0 comments

This very short how-to presents steps required to change controller name. It is oriented for less experienced users, which are starting their journey with Yii, to avoid common newbie pitfalls.

4 0
2
Viewed: 31 416 times
Version: 1.1
Category: How-tos

How to customize error handling in console-mode applications

Created 15 years ago by Steve Friedl Steve Friedl, updated 15 years ago by Steve Friedl Steve Friedl. 1 comment

One can control the detail of a web application in the webroot/index.php file by manipulating the values of YII_DEBUG and YII_TRACE_LEVEL, but these don't appear to be used by console applications. This is because although the base CApplication class defines a displayError() method that does consider these variable, CConsoleApplication overrides it with a function that doesn't honor th...

3 0
4
Viewed: 25 189 times
Version: 1.1
Category: How-tos

How to log and debug variables using CWebLogRoute

Created 15 years ago by Antonio Ramirez Antonio Ramirez, updated 15 years ago by Antonio Ramirez Antonio Ramirez. 8 comments

Yii comes with a set of powerful classes for logging. If you have read the documentation about logging messages, you have noticed that we can actually decide which messages we wish to log. And this is exactly what we are going to do, using [CWebLogRoute](http://www.yiiframework.com/doc/api/1.1/CWebLog...

13 0
20
Viewed: 82 855 times
Version: 1.1
Category: How-tos

Moving project code outside of webroot (plus multiple project support)

Created 15 years ago by Steve Friedl Steve Friedl, updated 15 years ago by Steve Friedl Steve Friedl. 8 comments

Yii's by-default directory organization works well enough, but there are several steps one can take that improve the security and serviceability of the system, especially in the context of multiple Yii projects on the same machine (including multiple versions of the same project).

21 1
19
Viewed: 71 769 times
Version: 1.1
Category: How-tos

Using standard filters in CGridView custom fields

Created 15 years ago by GOsha GOsha, updated 15 years ago by jwerner jwerner. 4 comments

In this article I'll try to explain how to use standard quick search fields in CGridView with customized columns.
For example:
We have a record in a database with field switch having 0 or 1 values. After that we want a user to see on or off instead 1 or 0.
So we do the usual thing:

<?php $this->widget('zii.widgets.grid.CGridView', array(
//.....
array(
    'name'=>'...
14 0
16
Viewed: 79 623 times
Version: 1.1
Category: How-tos

Increasing AR performance in connections with Oracle

Created 15 years ago by Trejder Trejder, updated 14 years ago by igorsantos07 igorsantos07. 14 comments

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
Viewed: 63 107 times
Version: 1.1
Category: How-tos

Multiple-database support in Yii

Created 15 years ago by Steve Friedl Steve Friedl, updated 14 years ago by phazei phazei. 18 comments

The customary configuration of a Yii application includes just a single database section in the protected/config/main.php file, but it's easy to extend this to support more than one, tying each Model to one of the databases.

20 0
39
Viewed: 155 435 times
Version: 1.1
Category: How-tos

Setting and getting systemwide static parameters

Created 15 years ago by Steve Friedl Steve Friedl, updated 15 years ago by Steve Friedl Steve Friedl. 3 comments

Occasionally one wishes to set systemwide parameters for an application, such as a contact address for email, an application name, or setting an option that guides major behavior. Yii provides for setting of static parameters in the configuration file, and this article talks about how to do it conveniently.

11 0
12
Viewed: 153 613 times
Version: 1.1
Category: How-tos