Mercurial > hg > extraction-interface
comparison classes/basecontroller.php @ 47:886f43b26ee2 extractapp
move/remove develop folder
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 17 Mar 2015 10:54:13 +0100 |
parents | |
children | 97c1e5102a22 |
comparison
equal
deleted
inserted
replaced
46:b3ca5d2b4d3f | 47:886f43b26ee2 |
---|---|
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 require($viewloc); | |
24 } else { | |
25 require($viewloc); | |
26 } | |
27 } | |
28 | |
29 protected function ReturnView_localtest($viewmodel, $fullview) { | |
30 $viewloc = 'views/' . get_class($this) . '/' . $this->action . '.php'; | |
31 if ($fullview) { | |
32 require('views/maintemplate_local.php'); | |
33 require($viewloc); | |
34 } else { | |
35 require($viewloc); | |
36 } | |
37 } | |
38 } | |
39 ?> |