BasicController.php
protected function viewDetail($id, $field)
    {
        $model = $this->findModel($id);
        $definition = array_merge($model->fields(), $model->extraFields());
        if (isset($definition[$field])) {
            return is_string($definition[$field]) ? $model->{$definition[$field]} : call_user_func($definition[$field], $model, $field);
        } elseif (in_array($field, $definition)) {
            return $model->$field;
        }
        throw new NotFoundHttpException("Object not found: $id/$field");
    }
protected function viewDetail($id, $field)
    {
        $model = $this->findModel($id);
        $definition = array_merge($model->fields(), $model->extraFields());
        if (isset($definition[$field])) {
            return is_string($definition[$field]) ? $model->{$definition[$field]} : call_user_func($definition[$field], $model, $field);
        } elseif (in_array($field, $definition)) {
            return $model->$field;
        }
        throw new NotFoundHttpException("Object not found: $id/$field");
    }
protected function viewDetail ( $ id , $ field ) { $ model = $ this -> findModel ( $ id ) ; $ definition = array_merge ( $ model -> fields ( ) , $ model -> extraFields ( ) ) ; if ( isset ( $ definition [ $ field ] ) ) { return is_string ( $ definition [ $ field ] ) ? $ model -> { $ definition [ $ field ] } : call_user_func ( $ definition [ $ field ] , $ model , $ field ) ; } elseif ( in_array ( $ field , $ definition ) ) { return $ model -> $ field ; } throw new NotFoundHttpException ( "Object not found: $id/$field" ) ; }
Displays a single filed of model.
@param integer $id
@return mixed
Displays a single filed of model .