Wiki

Articles in category "tips", sorted by viewsX
Displaying 51-60 of 151 result(s).

Rendering Views and Updating them with Ajax

Created 2 years ago by Manish GuptaTips4 comments – viewed 18,627 times – ( +2 )
I wanted to implement a widget that could refresh itself through Ajax without refreshing the whole page. CGridView and CListView are excellent examples of such widgets.

Yii Security-extended guide

Created 4 years ago by bingjie2680Tips11 comments – viewed 18,392 times – ( +6 / -6 ) – version 1.1
This article is called extended guide is because there is already a security guide in the Yii tutorial security section. but that guide is not complete in the sense that it does not rise the developers' attention to some other commonly happening attacks: SQL injection and magic URL, which can be major vulnerabilities in your application without much caring.

FORM with GET method causes repeated stacking of URL Parameters

Created 2 years ago by Kartik VTips2 comments – viewed 17,212 times – ( +42 / -4 ) – version all
You are using an ActiveForm in yii (both v1.x or 2), with a GET method like below:

Using jQuery UI 1.8.10 themes with Yii 1.1.6

Created 5 years ago by a110yTips7 comments – viewed 16,896 times – ( +2 ) – version 1.1
When using the latest stable jQuery UI themes (1.8.10) with Yii 1.1.6 (which uses 1.8.6) the widgets don't appear (they're invisible but they're there). In order to make them visible you need to change the following line:

A simple class to use a different db for a module

Created 5 years ago by tydeas_drTips3 comments – viewed 16,634 times – ( +9 ) – version 1.1
What would you do if you want/need to have a different than the main database connection in an module's models?

Code style

Created 5 years ago by zaccariaTips2 comments – viewed 16,435 times – ( +29 ) – version 1.1
Often, when writing widgets or editing Yii code, it is unclear whether or not the code is following the MVC pattern.
tags: mvc

Extending CActiveForm for some form display fixes and language tweaks

Created 5 years ago by TrejderTips0 comments – viewed 15,974 times – ( +5 ) – version 1.1
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.

Customizing Yii's formatting rules (extending CFormatter)

Created 4 years ago by HaenselTips0 comments – viewed 15,777 times – ( +14 ) – version 1.1
CFormatter is one of Yii's core components and used to format values displayed in widgets like CGridView or CDetailView. All classic formats like numbers, text, urls or datetime are supported but you may have to use a formatting rule that isn't built in. Let's say we want to display arrays of strings (like tags associated with a product model). When using CDetailView we would usually make use of PHPs implode function to create a simple string value of all values in the $product->tags array.

BootProgressColumn - Progress Bar Inside GridView Column compatible with 'bootstrap' extension

Created 3 years ago by LuizTips1 comment – viewed 14,990 times – ( +7 ) – version 1.1
A little hint of how to create a progress bar inside the column of the grid, using the 'bootstrap' extension.

Auto TDD - How to auto-run PHPUnit

Created 5 years ago by imeheszTips3 comments – viewed 14,916 times – ( +3 / -1 ) – version 1.1
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