/+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 Common/AbstractController.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
abstract class AbstractController {
4
 
  public function
5
 
  __construct () {
6
 
  
 
4
  protected function
 
5
  __contructor () {
 
6
    
7
7
  }
8
8
  
9
9
  public function
14
14
  
15
15
  /**
16
16
   * This should return a list of method names.
17
 
   *
 
17
   * 
18
18
   * @code{.php}
19
19
    function get_methods () {
20
20
      $ret_val = [
22
22
        "method_two",
23
23
        ...
24
24
      ];
25
 
    
 
25
      
26
26
      return ret_val;
27
27
    }
28
28
   * @endcode
29
29
   */
30
30
  abstract public function
31
31
  get_methods ();
32
 
 
 
32
  
33
33
  /*
34
34
   * Get the custom rout definitions.
35
35
   */
36
36
  //abstract public function get_routes ();
37
 
 
 
37
  
38
38
  /**
39
39
   * load a view class.
40
40
   */
41
41
  public function
42
 
  load_view ($view, $user_data = NULL) {
 
42
  load_view ($view, $user_data) {
43
43
    require (APP_DIR . "Views" . DS . $view . ".php");
44
44
    $_view = new $view ();
45
45
    $_view->render ($user_data);
46
46
  }
47
47
  
48
 
  public function
49
 
  load_view_raw ($view, $user_data = NULL) {
50
 
    $file_path = APP_DIR . DS . "Views" . DS . $view;
51
 
    include ($file_path);
52
 
  }
53
 
  
54
48
  /**
55
49
   * Returns a model object
56
50
   */
61
55
    
62
56
    return $$model;
63
57
  }
64
 
 
 
58
  
65
59
}