Showing 561-580 of 652 items.

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 246 times
Version: 1.1
Category: Tips

CSS Naming Conventions

Created 15 years ago by qiang qiang, updated 7 years ago by samdark samdark. 4 comments

In this article, we introduce a set of CSS naming conventions that we have applied in several big projects and achieved success. The goal of these naming conventions is to eliminate the possibility of naming conflicts, facilitate debugging and maintenance, and to simplify the naming process.

35 0
24
Viewed: 58 706 times
Version: 1.1
Category: Tutorials

Multiple Databases and Multiple Domains

Created 16 years ago by got 2 doodle got 2 doodle, updated 15 years ago by Maurizio Domba Cerin Maurizio Domba Cerin. 2 comments

Add these lines in /config/main.php

'components'=>array(
.........
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=database1',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => 'itsasecret',
			'charset' => 'utf8',
		),
		'db2'=>array(
		    'class' => 'CDbConnection',
			'connectionString' => 'mysql:host=localhost;dbname=databa...
13 2
15
Viewed: 63 705 times
Version: 1.1
Category: Tutorials

Named scope - Get orphan AR without losing primary key

Created 16 years ago by cma cma, updated 15 years ago by Steve Friedl Steve Friedl. 0 comments

Sometime, in a many-to-many relation, you need to retrieve AR that aren't linked. In practice, AR with null value in the join table. So you implements a criteria like this :

public function scopeUnused( $useAnd = true )
    {
        $join = " left outer join composed_by j on t.ID = j.ID ";
        $condition = ' j.ID Is Null';

0 0
2
Viewed: 12 119 times
Version: 1.1
Category: Tutorials