/** * @role save */ public function save() { $code = $this->request->get('code'); $css = new EditedCssFile($this->request->get('file')); $css->setCode($code); $res = $css->save(); if ($res) { return new JSONResponse(array('css' => $css->toArray()), 'success', $this->translate('_css_file_has_been_successfully_updated')); } else { return new JSONResponse(false, 'failure', $this->translate('_could_not_update_css_file')); } }
public function cssIframe() { $this->setLayout('empty'); $theme = $this->request->get('theme'); $css = new EditedCssFile($theme); if (!$css->getCode()) { $css->setCode(' '); $css->save(); } $response = new ActionResponse(); $response->set('theme', $theme); $response->set('file', $css->getFileName()); return $response; }