/lib/Milk/Views/BaseView.php
PHP | 30 lines | 23 code | 7 blank | 0 comment | 2 complexity | cf51a203b0e983c0fe133d91a2a3a3a7 MD5 | raw file
Possible License(s): GPL-2.0
- <?php
- namespace Milk\Views;
-
- use \F3 as F3;
-
- class BaseView {
-
- protected $method;
- protected $request;
- protected $query;
-
- public function __construct() {
- $this->method = $_SERVER['REQUEST_METHOD'];
- $req = explode('/', $_SERVER['REQUEST_URI']);
- array_shift($req);
- $this->request = $req;
- $this->query = $_SERVER['QUERY_STRING'];
- }
-
- public function __call($name, $arguments) {
- if (!method_exists($this, $name))
- if (!F3::get('RELEASE'))
- trigger_error("View $name does not exist in ".get_class($this));
- else
- F3::http404();
-
- return $this->fields[$args[0]];
- }
-
- }