/+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 16:39:13 UTC
  • mfrom: (4.1.1 StupidMVC)
  • Revision ID: gustav.hartvigsson@gmail.com-20160316163913-9esig2inohayiih3
* merged with parent

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
2
2
 
3
3
class Welcome extends AbstractController {
4
 
  
5
 
  private $data = [];
6
 
  
7
 
  public function
8
 
  __construct () {
9
 
    $this->data["page_title"] = "Welcome to my Super site!";
10
 
  }
11
 
  
12
 
  public function
13
 
  get_methods () {
 
4
 
 
5
  public function get_methods () {
14
6
    return [
15
7
      "hello" => "hello",
16
8
      "hello_again" => "hello"
17
9
    ];
18
10
  }
19
 
  
20
 
  public function
21
 
  hello ($args) {
22
 
    $this->load_view_raw ("header.php", $this->data);
 
11
 
 
12
  public function hello ($args) {
23
13
    if (count ($args) < 1) {
24
14
      echo "Too few arguments to the hello () method.";
25
 
      $this->load_view_raw ("footer.php");
26
15
      return;
27
16
    }
28
 
    
 
17
 
29
18
    echo "Hello " . $args[0];
30
 
    $this->load_view_raw ("footer.php");
31
 
  }
32
 
 
33
 
  public function
34
 
  default_method ($args) {
35
 
    $this->load_view_raw ("header.php", $this->data);
36
 
    $this->load_view ("WelcomeView");
37
 
    $this->load_view_raw ("footer.php");
38
 
  }
 
19
  }
 
20
 
 
21
  public function default_method ($args) {
 
22
    ob_start ();
 
23
    $this->load_view ("WelcomeView", NULL);
 
24
    ob_end_flush ();
 
25
  }
 
26
 
 
27
  /*
 
28
  public function get_routes () {
 
29
    return NULL;
 
30
  }
 
31
  */
 
32
 
39
33
}