1 |
<?php |
2 |
|
3 |
/** |
4 |
* This file contains the phpHtmlLib::controller::WebMVC class, |
5 |
* which inherits from the DesignPattern::MVC class. |
6 |
* |
7 |
* @author Andreas Motl <andreas.motl@ilo.de> |
8 |
* @package phpHtmlLib |
9 |
* @module controller::WebMVC |
10 |
* @base DesignPattern::MVC |
11 |
* |
12 |
*/ |
13 |
|
14 |
/** |
15 |
* $Id: WebMVC.inc,v 1.2 2003/03/01 21:19:02 joko Exp $ |
16 |
* |
17 |
* $Log: WebMVC.inc,v $ |
18 |
* Revision 1.2 2003/03/01 21:19:02 joko |
19 |
* now actually does something via '->handle' |
20 |
* established static component registry here |
21 |
* |
22 |
* Revision 1.1 2003/03/01 17:02:09 joko |
23 |
* + initial commit, inheriting from DesignPattern::MVC |
24 |
* |
25 |
* |
26 |
*/ |
27 |
|
28 |
|
29 |
/** |
30 |
* This tries to implement some parts of the MVC Pattern |
31 |
* suitable to work together with phpHtmlLib or maybe |
32 |
* another Web-Framework written in php. |
33 |
* |
34 |
* |
35 |
* @author Andreas Motl <andreas.motl@ilo.de> |
36 |
* @copyright (c) 2003 - All Rights reserved. |
37 |
* @license GNU LGPL (GNU Lesser General Public License) |
38 |
* |
39 |
* @author-url http://www.netfrag.org/~joko/ |
40 |
* @license-url http://www.gnu.org/licenses/lgpl.txt |
41 |
* |
42 |
* @package phpHtmlLib |
43 |
* @module controller::WebMVC |
44 |
* @base DesignPattern::MVC |
45 |
* |
46 |
*/ |
47 |
|
48 |
/** |
49 |
* Todo: |
50 |
* |
51 |
* o xyz |
52 |
* o bla, bli, blub |
53 |
* |
54 |
* |
55 |
*/ |
56 |
|
57 |
|
58 |
// isn't required by now: |
59 |
//loadModule('DesignPattern::Object'); |
60 |
//class DesignPattern_MVC extends DesignPattern_Object { |
61 |
|
62 |
loadModule('DesignPattern::MVC'); |
63 |
class WebMVC extends DesignPattern_MVC { |
64 |
|
65 |
|
66 |
/** |
67 |
* The constructor ... |
68 |
* ... just does nothing again. |
69 |
* |
70 |
* @param registry |
71 |
*/ |
72 |
function WebMVC() { |
73 |
// new!!! user_setup (like phpHtmlLib... coming closer...) |
74 |
$this->user_setup(); |
75 |
} |
76 |
|
77 |
function user_setup() { |
78 |
$this->_abstract_method('user_setup'); |
79 |
} |
80 |
|
81 |
function handle() { |
82 |
|
83 |
// trace |
84 |
print "MVC - performed result: " . Dumper($this->_performed_result); |
85 |
//exit; |
86 |
|
87 |
if (!sizeof($this->_performed_result)) { |
88 |
user_error("MVC failed - performed result was empty."); |
89 |
} |
90 |
|
91 |
// encapsulation here - no passthrough!!! |
92 |
$result = array( |
93 |
'view' => $this->_performed_result[view], |
94 |
'options' => $this->_performed_result[options], |
95 |
); |
96 |
|
97 |
return $result; |
98 |
} |
99 |
|
100 |
|
101 |
function &getStaticRegistryDatabase() { |
102 |
$registry = array ( |
103 |
'123435-54554-435435-435345' => array( |
104 |
'name' => 'Page::Overview', |
105 |
'version' => null, |
106 |
), |
107 |
'456-54554-435435-435345' => array( |
108 |
'name' => 'Page::Jobs', |
109 |
'version' => null, |
110 |
), |
111 |
'678-54554-435435-435345' => array( |
112 |
'name' => 'Page::DataBrowser', |
113 |
'version' => null, |
114 |
), |
115 |
'555-54554-435435-435345' => array( |
116 |
'name' => 'Page::NavigationHistory', |
117 |
'version' => null, |
118 |
), |
119 |
); |
120 |
return $registry; |
121 |
} |
122 |
|
123 |
|
124 |
|
125 |
/* |
126 |
function add_model() { |
127 |
$this->_abstract_method('add_model'); |
128 |
} |
129 |
|
130 |
function add_view() { |
131 |
$this->_abstract_method('add_view'); |
132 |
} |
133 |
|
134 |
function add_controller() { |
135 |
$this->_abstract_method('add_controller'); |
136 |
} |
137 |
|
138 |
function setup_views() { |
139 |
$this->_abstract_method('setup_views'); |
140 |
} |
141 |
*/ |
142 |
|
143 |
} |
144 |
|
145 |
?> |