Mercurial > hg > extraction-interface
comparison develop/classes/basecontroller.php @ 6:63e08b98032f
rewrite extraction interface into PHP MVC architecture.
(Although js hasn't been rewritten into MVC, it's fitted into the current PHP MVC architecture.)
- The root of the new PHP MVC is at 'develop/'.
- extraction interface is called "Extractapp" with several action, eg TaggingText, EditWordlist, EditTaglist, ExportTable.
| author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
|---|---|
| date | Thu, 05 Feb 2015 16:07:53 +0100 |
| parents | |
| children | ac77748bb813 |
comparison
equal
deleted
inserted
replaced
| 5:cbbb7ef22394 | 6:63e08b98032f |
|---|---|
| 1 <?php | |
| 2 // an instance of the BaseController class can't be created directly; | |
| 3 // it can only be extended/inherited by other classes | |
| 4 abstract class BaseController { | |
| 5 | |
| 6 protected $urlvalues; | |
| 7 protected $action; | |
| 8 | |
| 9 public function __construct($action, $urlvalues, $postdata) { | |
| 10 $this->action = $action; | |
| 11 $this->urlvalues = $urlvalues; | |
| 12 $this->postdata = $postdata; | |
| 13 } | |
| 14 | |
| 15 public function ExecuteAction() { | |
| 16 return $this->{$this->action}(); | |
| 17 } | |
| 18 | |
| 19 protected function ReturnView($viewmodel, $fullview) { | |
| 20 $viewloc = 'views/' . get_class($this) . '/' . $this->action . '.php'; | |
| 21 if ($fullview) { | |
| 22 require('views/maintemplate.php'); | |
| 23 } else { | |
| 24 require($viewloc); | |
| 25 } | |
| 26 } | |
| 27 } | |
| 28 ?> |
