コード例 #1
0
 /**
  * @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'));
     }
 }
コード例 #2
0
ファイル: ThemeController.php プロジェクト: saiber/www
 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;
 }