/** * * @param houserulesData $data * @return type */ public function getByHouseruleId($data) { $model = new Houserules(); $result = $model->findByPk($data->id); $view = $result ? 'byhouseruleid/done' : 'byhouseruleid/error'; $params = $result ? array('format' => $data->format, 'data' => $result->attributes) : array('format' => $data->format); $body = $this->renderPartial($view, $params, true); return $this->response->goodResponse($body); }