milk /lib/Milk/Views/BaseView.php

Language PHP Lines 30
MD5 Hash cf51a203b0e983c0fe133d91a2a3a3a7
Repository https://github.com/geekbuntu/milk.git View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?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]];
    }
	
}
Back to Top