helpers/KatoHtml.php
public static function value($model,$attribute,$defaultValue=null)
    {
        if(is_scalar($attribute) || $attribute===null)
            foreach(explode('.',$attribute) as $name)
            {
                if(is_object($model) && isset($model->$name))
                    $model=$model->$name;
                elseif(is_array($model) && isset($model[$name]))
                    $model=$model[$name];
                else
                    return $defaultValue;
            }
        else
            return call_user_func($attribute,$model);
        return $model;
    }
public static function value($model,$attribute,$defaultValue=null)
    {
        if(is_scalar($attribute) || $attribute===null)
            foreach(explode('.',$attribute) as $name)
            {
                if(is_object($model) && isset($model->$name))
                    $model=$model->$name;
                elseif(is_array($model) && isset($model[$name]))
                    $model=$model[$name];
                else
                    return $defaultValue;
            }
        else
            return call_user_func($attribute,$model);
        return $model;
    }
Evaluates the value of the specified attribute for the given model.
The attribute name can be given in a dot syntax. For example, if the attribute
is "author.firstName", this method will return the value of "$model->author->firstName".
A default value (passed as the last parameter) will be returned if the attribute does
not exist or is broken in the middle (e.g. $model->author is null).
The model can be either an object or an array. If the latter, the attribute is treated
as a key of the array. For the example of "author.firstName", if would mean the array value
"$model['author']['firstName']".

@param mixed $model the model. This can be either an object or an array.
@param mixed $attribute the attribute name (use dot to concatenate multiple attributes)
or anonymous function (PHP 5.3+). Remember that functions created by "create_function"
are not supported by this method. Also note that numeric value is meaningless when
first parameter is object typed.
@param mixed $defaultValue the default value to return when the attribute does not exist.
@return mixed the attribute value.