original_string: 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");
      }
code: 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");
      }
code_tokens: 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" ) ; }
docstring: Displays a single filed of model.
  @param integer $id
  @return mixed
docstring_tokens: Displays a single filed of model .