TemplatePropAction.class.php (637B)
1 <?php 2 namespace cms\action\template; 3 use cms\action\Method; 4 use cms\action\TemplateAction; 5 use language\Messages; 6 7 8 class TemplatePropAction extends TemplateAction implements Method { 9 10 11 public function view() { 12 13 $this->setTemplateVar('name' , $this->template->name ); 14 $this->setTemplateVar('publish' , $this->template->publish ); 15 } 16 17 18 public function post() { 19 20 $this->request->handleText('name',function($value) { 21 $this->template->name = $value; 22 }); 23 24 $this->template->publish = $this->request->isTrue('publish'); 25 $this->template->save(); 26 27 $this->addNoticeFor($this->template,Messages::SAVED); 28 } 29 }