File modules/cms/action/model/ModelPropAction.class.php
Last commit: Wed Mar 9 13:28:52 2022 +0100 dankert Refactoring: Checkbox values are always sent to the server. In the actions we must test the value with 'isTrue()'
1 <?php 2 namespace cms\action\model; 3 use cms\action\Method; 4 use cms\action\ModelAction; 5 use language\Messages; 6 7 8 class ModelPropAction extends ModelAction implements Method { 9 10 public function view() { 11 $this->setTemplateVar('name' ,$this->model->name ); 12 $this->setTemplateVar('is_default',$this->model->isDefault ); 13 } 14 15 public function post() { 16 if ( $name = $this->request->getText('name') ) { 17 $this->model->name = $name; 18 $this->model->save(); 19 } 20 21 if ( $this->request->isTrue('is_default') ) 22 $this->model->setDefault(); 23 24 $this->addNoticeFor( $this->model, Messages::DONE ); 25 } 26 }
Downloadmodules/cms/action/model/ModelPropAction.class.php
History Wed, 9 Mar 2022 13:28:52 +0100 dankert Refactoring: Checkbox values are always sent to the server. In the actions we must test the value with 'isTrue()' 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.