Wiki articles

Showing 41-60 of 822 items.

Multiple Databases and Multiple Domains

Created 13 years ago by got 2 doodle, updated 13 years ago by Maurizio Domba Cerin.

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 followers
Viewed: 55 221 times
Version: 1.1
Category: Tutorials
Tags: database

Styling Radio Buttons

Created 13 years ago by Steve Friedl, updated 13 years ago by Steve Friedl.

The default behavior with radio button lists is ugly, and I figured out mostly how to style them a coupla different ways. I'll used the blog tutorial example (but with my own posting modes):

10 0
9 followers
Viewed: 68 959 times
Version: 1.1
Category: Tips

Using setFlash for displaying various kind of messages

Created 13 years ago by Trejder, updated 13 years ago by Trejder.

In this short how-to I will show how to customize setFlash() to display messages (flashes) styled to be success confirmation, error report or notice information. And how to achieve displaying errors in other way.

5 4
6 followers
Viewed: 91 710 times
Version: 1.1
Category: How-tos

How to customize error handling in console-mode applications

Created 13 years ago by Steve Friedl, updated 13 years ago by Steve Friedl.

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

3 0
4 followers
Viewed: 21 041 times
Version: 1.1
Category: How-tos

Extending CActiveForm for some form display fixes and language tweaks

Created 13 years ago by Trejder, updated 13 years ago by Trejder.

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 followers
Viewed: 23 919 times
Version: 1.1
Category: Tips

How to log and debug variables using CWebLogRoute

Created 13 years ago by Antonio Ramirez, updated 13 years ago by Antonio Ramirez.

Yii comes with a set of powerful classes for logging. If you have read the documentation about logging messages, you have noticed that we can actually decide which messages we wish to log. And this is exactly what we are going to do, using [CWebLogRoute](http://www.yiiframework.com/doc/api/1.1/CWebLog...

13 0
20 followers
Viewed: 78 259 times
Version: 1.1
Category: How-tos
Tags: Logging

ChromePHP for Yii

Created 13 years ago by imehesz, updated 13 years ago by imehesz.

ChromePHP is a console logging extension for Google Chrome.

3 1
4 followers
Viewed: 18 264 times
Version: 1.1
Category: Tips

Performance - A Guide For Best Practice

Created 14 years ago by Y!!, updated 13 years ago by ajsharma.

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.

9 5
10 followers
Viewed: 27 129 times
Version: 1.1
Category: Tutorials

Quick Tip about Pagination Params

Created 13 years ago by Antonio Ramirez, updated 13 years ago by Antonio Ramirez.

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?

5 0
8 followers
Viewed: 62 753 times
Version: 1.1
Category: Tips

Using standard filters in CGridView custom fields

Created 13 years ago by GOsha, updated 13 years ago by jwerner.

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:

<?php $this->widget('zii.widgets.grid.CGridView', array(
//.....
array(
    'name'=>'...
14 0
16 followers
Viewed: 74 019 times
Version: 1.1
Category: How-tos

Auto TDD - How to auto-run PHPUnit

Created 13 years ago by imehesz, updated 13 years ago by imehesz.

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 followers
Viewed: 20 744 times
Version: 1.1
Category: Tips

Putting Function To Be Called In View

Created 13 years ago by junxiong, updated 13 years ago by junxiong.

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 followers
Viewed: 51 760 times
Version: 1.1
Category: Tips
Tags: render, view

Setting and getting systemwide static parameters

Created 13 years ago by Steve Friedl, updated 13 years ago by Steve Friedl.

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.

11 0
12 followers
Viewed: 146 048 times
Version: 1.1
Category: How-tos
Tags: config

belajar AR : part 1 (learn AR : part 1)

Created 13 years ago by rianday, updated 13 years ago by rianday.

hai teman yii... apa kabar.. kembali lagi bersama catatan saya..

0 0
1 follower
Viewed: 17 738 times
Version: 1.1
Category: Tutorials
Tags: indonesia

embed a view file of the class which implement the CAction.

Created 13 years ago by Davidhhuan, updated 13 years ago by Davidhhuan.

In Yii, we can define an action class and ask the controller to instantiate it. And we always create ourselves actions class in rootPath/protected/extensions, and the view file we called in the actions class always are located in rootPath/protected/views/ControllerNAME or rootPath/themes/ThemeNAME/ControllerNAME, then when we use the same actions class in different controllers, we have to copy it...

1 1
2 followers
Viewed: 25 109 times
Version: 1.1
Category: Tutorials

Introducción al control de acceso basado en roles (RBAC)

Created 13 years ago by Juan Calvo, updated 13 years ago by Juan Calvo.

Todos los que hemos empezado a utilizar Yii para crear aplicaciones Web, nos hemos dado de bruces cuando hemos intentado poner a funcionar el RBAC (acceso de control basado en roles).

15 1
9 followers
Viewed: 73 303 times
Version: 1.1
Category: Tutorials

Mais segurança em suas aplicações com Yii e PHPIDS

Created 13 years ago by Rafael Garcia, updated 13 years ago by Rafael Garcia.

PHPIDS é conhecido projeto que pode ser visto em php-ids.org.

2 1
3 followers
Viewed: 12 423 times
Version: 1.1
Category: How-tos

Yii code completion and calltips in Komodo Edit

Created 13 years ago by viter, updated 13 years ago by wei.

My favourite editor is Komodo Edit (free and crossplatform) and I use it for my everyday coding work. Just recently I found out how to make it help me to work with Yii. :) So follow these steps:

5 0
3 followers
Viewed: 14 612 times
Version: 1.1
Category: Tips

Enforcing "You must agree" requirements in forms

Created 13 years ago by Steve Friedl, updated 13 years ago by Steve Friedl.

Checkboxes have two possible values, true and false, but some applications require that the user select one particular value before proceeding. Examples might be:

25 0
17 followers
Viewed: 33 231 times
Version: 1.1
Category: How-tos

More security in your applications with Yii and PHPIDS

Created 13 years ago by Rafael Garcia, updated 13 years ago by Gustavo.

PHPIDS is a well known project that can be found in php-ids.org.

6 0
14 followers
Viewed: 19 970 times
Version: 1.1
Category: How-tos