'config_templates_list.yaml', 'layouts' => 'config_layouts_list.yaml', ]; public $formConfig = 'config_form.yaml'; public function __construct() { parent::__construct(); BackendMenu::setContext('October.System', 'system', 'settings'); SettingsManager::setContext('Renatio.DynamicPDF', 'templates'); } public function index($tab = null) { $this->asExtension('ListController')->index(); $this->bodyClass = 'compact-container'; $this->vars['activeTab'] = $tab ?: 'templates'; } public function formBeforeSave($model) { $model->is_custom = 1; } public function previewPdf($id) { $this->pageTitle = trans('renatio.dynamicpdf::lang.templates.preview_pdf'); try { $model = $this->formFindModelObject($id); } catch (ApplicationException $e) { return $this->handleError($e); } return PDF::loadTemplate($model->code) ->setLogOutputFile(storage_path('temp/log.htm')) ->setIsRemoteEnabled(true) ->stream(); } public function html($id) { $model = $this->formFindModelObject($id); return response($model->html); } public function update_onResetDefault($recordId) { $model = $this->formFindModelObject($recordId); $model->fillFromCode(); $model->save(); Flash::success(e(trans('backend::lang.form.reset_success'))); return redirect()->refresh(); } }