Wiki

Articles in category "how-tos"X
Displaying 291-300 of 309 result(s).

Multiple-database support in Yii

Created 3 years ago by Steve FriedlHow-tos14 comments – viewed 66,332 times – ( +28 ) – version 1.1
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.
tags: Database

Increasing AR performance in connections with Oracle

Created 3 years ago by TrejderHow-tos10 comments – viewed 16,689 times – ( +1 ) – version 1.1
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.

Using standard filters in CGridView custom fields

Created 3 years ago by GOshaHow-tos4 comments – viewed 49,661 times – ( +17 ) – version 1.1
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:

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

Created 3 years ago by Steve FriedlHow-tos8 comments – viewed 38,752 times – ( +22 / -1 ) – version 1.1
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).
tags: config, security

How to log and debug variables using CWebLogRoute

Created 3 years ago by Antonio RamirezHow-tos7 comments – viewed 47,684 times – ( +18 ) – version 1.1
I have seen a couple of articles about how to integrate external libraries to debug our PHP code (i.e. firePHP) but after you read this article you will realize that there is no need for such libraries when using Yii.
tags: Logging

How to customize error handling in console-mode applications

Created 3 years ago by Steve FriedlHow-tos1 comment – viewed 8,539 times – ( +3 ) – version 1.1
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 them.

Changing Controllers Name

Created 3 years ago by TrejderHow-tos0 comments – viewed 12,206 times – ( +4 ) – version 1.1
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.

Using setFlash for displaying various kind of messages

Created 3 years ago by TrejderHow-tos6 comments – viewed 41,939 times – ( +4 / -5 ) – version 1.1
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.
tags: flash, error, message

Using CButtonColumn to customize buttons in CGridView

Created 3 years ago by TrejderHow-tos17 comments – viewed 191,000 times – ( +96 ) – version 1.1
CGridView is a one of most flexible widgets in Yii and example its flexibility is CButtonColumn used to build buttons for steering model in each grid row. Here in this how-to we will explain ways user can customize CButtonColumn to flexibly fit it to its needs.

How to use PHPExcel external library with Yii

Created 3 years ago by Antonio RamirezHow-tos13 comments – viewed 59,908 times – ( +29 / -1 ) – version 1.1
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?