framework/utils/CFormatter.php
public function format($value,$type)
	{
		$method='format'.$type;
		if(method_exists($this,$method))
			return $this->$method($value);
		else
			throw new CException(Yii::t('yii','Unknown type "{type}".',array('{type}'=>$type)));
	}
public function format($value,$type)
	{
		$method='format'.$type;
		if(method_exists($this,$method))
			return $this->$method($value);
		else
			throw new CException(Yii::t('yii','Unknown type "{type}".',array('{type}'=>$type)));
	}
public function format ( $ value , $ type ) { $ method = 'format' . $ type ; if ( method_exists ( $ this , $ method ) ) return $ this -> $ method ( $ value ) ; else throw new CException ( Yii :: t ( 'yii' , 'Unknown type "{type}".' , array ( '{type}' => $ type ) ) ) ; }
Formats a value based on the given type.
@param mixed $value the value to be formatted
@param string $type the data type. This must correspond to a format method available in CFormatter.
For example, we can use 'text' here because there is method named {@link formatText}.
@throws CException if given type is unknown
@return string the formatted data
Formats a value based on the given type .