Wiki articles in category How-tos

Showing 1-20 of 292 items.

How to set up Unicode

Created 10 years ago by Mike, updated 6 years ago by Roman Solomatin.

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
13 followers
Viewed: 107 987 times
Version: 1.1
Category: How-tos
Tags: i18n, unicode

How to use nested DB transactions (MySQL 5+, PostgreSQL)

Created 9 years ago by mindeh, updated 3 years ago by Boaz.

Original source code and idea are from: PHP, PDO & Nested Transactions.

41 0
26 followers
Viewed: 50 020 times
Version: 1.1
Category: How-tos

Reference: Model rules validation

Created 9 years ago by krillzip, updated 5 years ago by Rodrigo.

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.

97 0
115 followers
Viewed: 810 114 times
Version: 1.1
Category: How-tos

How to setup RBAC with a php file

Created 9 years ago by bettor, updated 6 years ago by Stageline.

In this cookbook I will attempt to explain how to use the lightweight version of Role-Based Access Control using a php file. This version does not use database but a php file and is controlled by CPhpAuthManager class.

24 4
21 followers
Viewed: 73 072 times
Version: 1.1
Category: How-tos

How to install pdo_oci

Created 9 years ago by gallego123, updated 8 years ago by gallego123.

From: http://lacot.org/ and me.

1 0
3 followers
Viewed: 32 198 times
Version: 1.1
Category: How-tos

Using the jamselect widget with min and max values

Created 8 years ago by got 2 doodle, updated 8 years ago by wei.

The keywords will be stored in a text field in a comma delimited format. The keywords will be created by the site administrator.

2 0
1 follower
Viewed: 13 551 times
Version: 1.1
Category: How-tos

Implementing cron jobs with Yii

Created 8 years ago by samdark, updated 8 years ago by samdark.

There are two ways to run a cron job:

27 2
27 followers
Viewed: 94 922 times
Version: 1.1
Category: How-tos
Tags: cli, cron

Using the jqueryslidemenu plugin with CMenu

Created 8 years ago by Antonio Ramirez, updated 8 years ago by pc131.

Yii makes it really easy for all to use their already made objects that automate everything we do. It provides also great power of flexibility and styling but hey, we programmers tend to complicate our lives and push a little more the power of our tools.

18 1
8 followers
Viewed: 36 407 times
Version: 1.1
Category: How-tos

Using recaptchlib in your projects

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

It is good when someone writes extensions for us but trust, sometimes we forget about other approaches that, if we know the library, we shouldn't forget.

5 0
4 followers
Viewed: 12 511 times
Version: 1.1
Category: How-tos

How to use PHPExcel external library with Yii

Created 8 years ago by Antonio Ramirez, updated 5 years ago by cgsmith.

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 followers
Viewed: 113 751 times
Version: 1.1
Category: How-tos

Using CButtonColumn to customize buttons in CGridView

Created 8 years ago by Trejder, updated 6 years ago by Gismo.

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
60 followers
Viewed: 315 015 times
Version: 1.1
Category: How-tos

Using setFlash for displaying various kind of messages

Created 8 years ago by Trejder, updated 8 years ago by Trejder.

In this short how-to I will show how to customize setFlash() to display messages (flashes) styled to be success confirmation, error report or notice information. And how to achieve displaying errors in other way.

4 4
6 followers
Viewed: 73 959 times
Version: 1.1
Category: How-tos

Changing Controllers Name

Created 8 years ago by Trejder, updated 6 years ago by Trejder.

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 followers
Viewed: 19 350 times
Version: 1.1
Category: How-tos

How to customize error handling in console-mode applications

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

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 followers
Viewed: 16 037 times
Version: 1.1
Category: How-tos

How to log and debug variables using CWebLogRoute

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

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 followers
Viewed: 70 315 times
Version: 1.1
Category: How-tos
Tags: Logging

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

Created 8 years ago by Steve Friedl, updated 7 years ago by Steve Friedl.

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 followers
Viewed: 55 854 times
Version: 1.1
Category: How-tos

Using standard filters in CGridView custom fields

Created 8 years ago by GOsha, updated 8 years ago by jwerner.

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 followers
Viewed: 68 127 times
Version: 1.1
Category: How-tos

Increasing AR performance in connections with Oracle

Created 8 years ago by Trejder, updated 7 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: 32 431 times
Version: 1.1
Category: How-tos

Multiple-database support in Yii

Created 8 years ago by Steve Friedl, updated 6 years ago by phazei.

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
40 followers
Viewed: 120 649 times
Version: 1.1
Category: How-tos
Tags: database

Setting and getting systemwide static parameters

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

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.

10 0
12 followers
Viewed: 126 977 times
Version: 1.1
Category: How-tos
Tags: config