File modules/cms/action/template/TemplatePreviewAction.class.php

Last commit: Fri Mar 18 22:38:42 2022 +0100	dankert	Refactoring: Extracted the TemplateGenerator out of the PageGenerator.
1 <?php 2 namespace cms\action\template; 3 use cms\action\Method; 4 use cms\action\RequestParams; 5 use cms\action\TemplateAction; 6 use cms\model\Project; 7 use util\Html; 8 9 10 class TemplatePreviewAction extends TemplateAction implements Method { 11 12 public function view() { 13 $project = new Project( $this->template->projectid); 14 15 $this->setTemplateVar('models',$project->getModels() ); 16 17 $modelId = $this->request->getModelId(); 18 if ( ! $modelId ) 19 $modelId = Project::create( $this->template->projectid )->getDefaultModelId(); 20 21 $this->setTemplateVar('modelid' ,$modelId); 22 23 $this->setTemplateVar('preview_url',Html::url('template','show',$this->template->templateid,array('target'=>'none','modelid'=>$modelId,'output'=>'preview' ) ) ); 24 } 25 public function post() { 26 } 27 }
Download modules/cms/action/template/TemplatePreviewAction.class.php
History Fri, 18 Mar 2022 22:38:42 +0100 dankert Refactoring: Extracted the TemplateGenerator out of the PageGenerator. Fri, 26 Feb 2021 01:06:01 +0100 Jan Dankert Refactoring accessing the request parameter values. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.