Showing 101-120 of 120 items.

Putting Function To Be Called In View

Created 15 years ago by junxiong junxiong, updated 15 years ago by junxiong junxiong. 2 comments

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:

5 1
5
Viewed: 55 279 times
Version: 1.1
Category: Tips

Auto TDD - How to auto-run PHPUnit

Created 15 years ago by imehesz imehesz, updated 15 years ago by imehesz imehesz. 3 comments

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!

3 0
6
Viewed: 22 979 times
Version: 1.1
Category: Tips

Directory independent extensions

Created 15 years ago by GOsha GOsha, updated 15 years ago by GOsha GOsha. 3 comments

Many people want to use downloaded extensions in their own way. As for me most of the extensions require me to correct Yii::import() instructions inside their source code. All these extensions are directory dependent. To avoid the situation described above, I suggest to implement pseudo-anonymous aliases:

// take the curr...
16 1
7
Viewed: 20 149 times
Version: 1.1
Category: Tips

Adding Yii Search to Your Browser Search Box

Created 15 years ago by qiang qiang, updated 8 years ago by CeBe CeBe. 1 comment

The official Yii project site now supports OpenSearch. This means you can customize your browser's search box to enable direct search of the content in yiiframework.com. For example, by entering a Yii class name in the browser's search box, the corresponding class API page will be shown in the browser.

25 0
6
Viewed: 71 050 times
Version: all
Category: Tips

Code style

Created 15 years ago by zaccaria zaccaria, updated 15 years ago by g3ck0 g3ck0. 2 comments

Often, when writing widgets or editing Yii code, it is unclear whether or not the code is following the MVC pattern.

29 0
7
Viewed: 32 875 times
Version: 1.1
Category: Tips

Extending CActiveForm for some form display fixes and language tweaks

Created 15 years ago by Trejder Trejder, updated 15 years ago by Trejder Trejder. 0 comments

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.

The colon

Here is overloaded version of CActiveForm.labelEx that adds colon (:) at the end of text of label with respecting CHtml::$afterRequiredLabel and CHtml::$beforeRequiredLabel

5 0
6
Viewed: 29 004 times
Version: 1.1
Category: Tips