Showing 61-80 of 120 items.

Using sub query for doubletts

Created 14 years ago by mb mb, updated 13 years ago by mb mb. 3 comments

find doubletts by db fields. in this example i will check doublets for 3 tabelfields (col1,col2,col3). so i will get a subquery with the condition, select and grouping of the tablefields. the having with COUNT() > 1 means: find all records more then one result.

$model=new MyModel('search');
$model->unsetAttributes();

3 0
10
Viewed: 28 923 times
Version: 1.1
Category: Tips

Extending CActiveForm for some form display fixes and language tweaks

Created 16 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: 30 002 times
Version: 1.1
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: 33 970 times
Version: 1.1
Category: Tips

Yii Security-extended guide

Created 14 years ago by bingjie2680 bingjie2680, updated 14 years ago by bingjie2680 bingjie2680. 11 comments

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 you...

6 6
12
Viewed: 38 504 times
Version: 1.1
Category: Tips