/+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 {
4.1.1 by Gustav Hartvigsson
* Woopes
4
3 by Gustav Hatvigsson
* Made the router a class
5
  public function get_methods () {
6
    return [
7
      "hello" => "hello",
8
      "hello_again" => "hello"
9
    ];
10
  }
4.1.1 by Gustav Hartvigsson
* Woopes
11
4 by Gustav Hatvigsson
* Added FourOhFour.php
12
  public function hello ($args) {
13
    if (count ($args) < 1) {
3 by Gustav Hatvigsson
* Made the router a class
14
      echo "Too few arguments to the hello () method.";
15
      return;
16
    }
4.1.1 by Gustav Hartvigsson
* Woopes
17
18
    echo "Hello " . $args[0];
3 by Gustav Hatvigsson
* Made the router a class
19
  }
4.1.1 by Gustav Hartvigsson
* Woopes
20
4 by Gustav Hatvigsson
* Added FourOhFour.php
21
  public function default_method ($args) {
5 by Gustav Hatvigsson
* changed a few small things
22
    ob_start ();
23
    $this->load_view ("WelcomeView", NULL);
24
    ob_end_flush ();
3 by Gustav Hatvigsson
* Made the router a class
25
  }
4.1.1 by Gustav Hartvigsson
* Woopes
26
3 by Gustav Hatvigsson
* Made the router a class
27
  /*
28
  public function get_routes () {
29
    return NULL;
30
  }
31
  */
4.1.1 by Gustav Hartvigsson
* Woopes
32
1 by Gustav Hartvigsson
* initial code
33
}