Wiki

Articles in category "how-tos"X
Displaying 161-170 of 183 result(s).

Mais segurança em suas aplicações com Yii e PHPIDS

Created 2 years ago by Rafael GarciaHow-tos0 comments – viewed 4,732 times – ( +2 / -1 )
PHPIDS é conhecido projeto que pode ser visto em php-ids.org.
tags: phpids, security

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

Created 2 years ago by Maurizio DombaHow-tos5 comments – viewed 23,092 times – ( +24 )
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.

Dynamic Sidebar using CClipWidget

Created 2 years ago by SheldmanduHow-tos4 comments – viewed 15,042 times – ( +19 )
Most applications will have one or two sidebars and often you want to control the content that should appear in the sidebar based on the action. For example you will want to show something different on the homepage as opposed to some view page. While achieving this you generally also want to avoid putting the layout into each view, as that would mean if you wanted to change the layout (e.g. put the sidebar on the left instead of the right or do some funky layout which requires an additional div tag to be added) you'd have to go through every view, which does not achieve good code re-use. It is also bad practice to have lots of if statements in column2 layout just so that you can generate the sidebar correctly.

Setting and getting systemwide static parameters

Created 2 years ago by Steve FriedlHow-tos2 comments – viewed 29,218 times – ( +10 )
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.
tags: config

Multiple-database support in Yii

Created 2 years ago by Steve FriedlHow-tos8 comments – viewed 36,121 times – ( +20 )
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 2 years ago by TrejderHow-tos6 comments – viewed 10,387 times
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 2 years ago by GOshaHow-tos4 comments – viewed 34,287 times – ( +15 )
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 2 years ago by Steve FriedlHow-tos5 comments – viewed 24,328 times – ( +22 / -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 2 years ago by Antonio RamirezHow-tos4 comments – viewed 28,864 times – ( +13 )
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 2 years ago by Steve FriedlHow-tos1 comment – viewed 5,665 times – ( +3 )
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.