response->type('xml'); } } /** * Render a XML view. * * Uses the special 'serialize' parameter to convert a set of * view variables into a XML response. Makes generating simple * XML responses very easy. You can omit the 'serialize' parameter, * and use a normal view + layout as well. * * @param string $view The view being rendered. * @param string $layout The layout being rendered. * @return string The rendered view. */ public function render($view = null, $layout = null) { if (isset($this->viewVars['serialize']) && is_array($this->viewVars['serialize'])) { return $this->output = Xml::fromArray($this->viewVars['serialize'])->asXML(); } return parent::render($view, $layout); } }