/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/controller/WebMVC.inc
ViewVC logotype

Annotation of /nfo/php/libs/com.newsblob.phphtmllib/controller/WebMVC.inc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Sat Mar 1 21:19:02 2003 UTC (21 years, 6 months ago) by joko
Branch: MAIN
Changes since 1.1: +44 -2 lines
now actually does something via '->handle'
established static component registry here

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

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed