/+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 Hartvigsson
  • Date: 2016-03-16 16:41:50 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20160316164150-zbrppdt5e743pzu5
* a few more functions...

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
abstract class AbstractController {
4
4
  protected function
5
5
  __contructor () {
6
 
    
 
6
 
7
7
  }
8
 
  
 
8
 
9
9
  public function
10
10
  default_method ($args) {
11
11
    echo "<h1>It Works!</h1>";
12
12
    echo "<b> You should add default_method () to your class. </b>";
13
13
  }
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
   */
44
44
    $_view = new $view ();
45
45
    $_view->render ($user_data);
46
46
  }
47
 
  
 
47
 
48
48
  /**
49
49
   * Returns a model object
50
50
   */
52
52
  load_model ($model) {
53
53
    require (APP_DIR . "Models " . DS . $model . ".php");
54
54
    $$model = new $model ();
55
 
    
 
55
 
56
56
    return $$model;
57
57
  }
58
 
  
 
58
 
59
59
}