/+junk/StupidMVC

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/StupidMVC

« back to all changes in this revision

Viewing changes to Application/Controllers/Welcome.php

  • Committer: Gustav Hatvigsson
  • Date: 2016-03-16 13:19:32 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20160316131932-4187dfwz43gl28hs
* Made the router a class
* Made routeing work
* removed get_route () from AbstractController

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
2
 
3
 
public class Welcome extends AbstractController {
4
 
  
 
3
class Welcome extends AbstractController {
 
4
  
 
5
  public function get_methods () {
 
6
    return [
 
7
      "hello" => "hello",
 
8
      "hello_again" => "hello"
 
9
    ];
 
10
  }
 
11
  
 
12
  public function hello ($val) {
 
13
    if (count ($val) < 1) {
 
14
      echo "Too few arguments to the hello () method.";
 
15
      return;
 
16
    }
 
17
    
 
18
    echo "Hello " . $val[0];
 
19
  }
 
20
  
 
21
  public function default_method () {
 
22
    echo "<h1> Hello from Welcome.php! </h1>";
 
23
  }
 
24
  
 
25
  /*
 
26
  public function get_routes () {
 
27
    return NULL;
 
28
  }
 
29
  */
5
30
  
6
31
}