/+junk/StupidMVC

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/StupidMVC
1 by Gustav Hartvigsson
* initial code
1
<?php
2
3 by Gustav Hatvigsson
* Made the router a class
3
class Welcome extends AbstractController {
11 by Gustav Hartvigsson
* changed how AbstractController->load_view_raw () works
4
  
5
  private $data = [];
6
  
7
  public function
8
  __construct () {
9
    $this->data["page_title"] = "Welcome to my Super site!";
10
  }
11
  
7 by Gustav Hartvigsson
* a few more functions...
12
  public function
13
  get_methods () {
3 by Gustav Hatvigsson
* Made the router a class
14
    return [
15
      "hello" => "hello",
16
      "hello_again" => "hello"
17
    ];
18
  }
11 by Gustav Hartvigsson
* changed how AbstractController->load_view_raw () works
19
  
7 by Gustav Hartvigsson
* a few more functions...
20
  public function
21
  hello ($args) {
11 by Gustav Hartvigsson
* changed how AbstractController->load_view_raw () works
22
    $this->load_view_raw ("header.php", $this->data);
4 by Gustav Hatvigsson
* Added FourOhFour.php
23
    if (count ($args) < 1) {
3 by Gustav Hatvigsson
* Made the router a class
24
      echo "Too few arguments to the hello () method.";
11 by Gustav Hartvigsson
* changed how AbstractController->load_view_raw () works
25
      $this->load_view_raw ("footer.php");
3 by Gustav Hatvigsson
* Made the router a class
26
      return;
27
    }
11 by Gustav Hartvigsson
* changed how AbstractController->load_view_raw () works
28
    
4.1.1 by Gustav Hartvigsson
* Woopes
29
    echo "Hello " . $args[0];
11 by Gustav Hartvigsson
* changed how AbstractController->load_view_raw () works
30
    $this->load_view_raw ("footer.php");
3 by Gustav Hatvigsson
* Made the router a class
31
  }
4.1.1 by Gustav Hartvigsson
* Woopes
32
7 by Gustav Hartvigsson
* a few more functions...
33
  public function
34
  default_method ($args) {
11 by Gustav Hartvigsson
* changed how AbstractController->load_view_raw () works
35
    $this->load_view_raw ("header.php", $this->data);
36
    $this->load_view ("WelcomeView");
37
    $this->load_view_raw ("footer.php");
38
  }
1 by Gustav Hartvigsson
* initial code
39
}