Wiki

Sorted by date (updated)X
Displaying 421-430 of 468 result(s).

Setting and getting systemwide static parameters

Updated 2 years ago by Steve FriedlHow-tos2 comments – viewed 28,917 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

Putting Function To Be Called In View

Updated 2 years ago by junxiongTips2 comments – viewed 13,949 times – ( +4 / -1 )
Sometimes we need some complicated view to be displayed (such as generating complicated table). Most people suggest that in MVC the View must be as simple as possible (don't have too much loops, etc). So what we have to do is to hide away the complex code by putting it at somewhere else. The following are few places options to keep the function:
tags: view, render

Auto TDD - How to auto-run PHPUnit

Updated 2 years ago by imeheszTips3 comments – viewed 9,129 times – ( +3 )
If you are lucky enough and have the privilege to develop on a Linux based environment, this little tip might boost-up your TDD process (at least the Unit Testing part). Please note, that this should work just fine with Apple computers also, but not tested!
tags: PHPUnit, testing, TDD

Using standard filters in CGridView custom fields

Updated 2 years ago by jwernerHow-tos4 comments – viewed 34,169 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:

Quick Tip about Pagination Params

Updated 2 years ago by Antonio RamirezTips2 comments – viewed 17,449 times – ( +5 )
Developing custom Grids and ListViews for my new CMS I was facing a small challenge: If I was to update/delete/batch delete items of my Grid, how would I return to the current page view?
tags: Pagination

Performance - A Guide For Best Practice

Updated 2 years ago by ajsharmaTutorials3 comments – viewed 11,632 times – ( +8 / -5 )
In this guide I will explain best practise regarding performance in MySQL, PHP and of course our loved Yii Framework. Since this is a complex topic, I will start with some basics and then expand this guide from time to time. Since this wiki can become big, you may click on View history - there you can see what changes have been made, so you don't miss anything.
tags: performance

ChromePHP for Yii

Updated 2 years ago by imeheszTips0 comments – viewed 7,223 times – ( +2 / -1 )
ChromePHP is a console logging extension for Google Chrome.

How to log and debug variables using CWebLogRoute

Updated 2 years ago by Antonio RamirezHow-tos4 comments – viewed 28,701 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

Extending CActiveForm for some form display fixes and language tweaks

Updated 2 years ago by TrejderTips0 comments – viewed 8,484 times – ( +5 )
In this simple example I'll demonstrate how to extend CActiveForm class to overload some drawing functions to achieve some commonly used fixes in forms.

How to customize error handling in console-mode applications

Updated 2 years ago by Steve FriedlHow-tos1 comment – viewed 5,633 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.