File modules/cms/action/modellist/ModellistAddAction.class.php
Last commit: Tue Feb 14 21:36:41 2023 +0100 Jan Dankert Fix: Get the project id from request.
1 <?php 2 namespace cms\action\modellist; 3 use cms\action\Method; 4 use cms\action\ModellistAction; 5 use cms\model\Model; 6 7 class ModellistAddAction extends ModellistAction implements Method { 8 public function view() { 9 } 10 11 12 public function post() { 13 $model = new Model(); 14 $model->projectid = $this->request->getId(); 15 $model->name = $this->request->getText('name'); 16 17 $model->persist(); 18 19 // if no name is given 20 if ( ! $model->name ) 21 { 22 // name is "model <id>" 23 $model->name = \cms\base\Language::lang('MODEL').' '.$model->modelid; 24 $model->persist(); 25 } 26 27 } 28 }
Downloadmodules/cms/action/modellist/ModellistAddAction.class.php
History Tue, 14 Feb 2023 21:36:41 +0100 Jan Dankert Fix: Get the project id from request. Fri, 26 Feb 2021 01:06:01 +0100 Jan Dankert Refactoring accessing the request parameter values. Wed, 18 Nov 2020 01:46:36 +0100 Jan Dankert Refactoring of model classes: New method persist() and some other cleanups. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.