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