/[cvs]/nfo/php/libs/org.netfrag.glib/DesignPattern/MVC.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.glib/DesignPattern/MVC.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by joko, Sat Mar 1 22:44:54 2003 UTC revision 1.5 by joko, Mon Mar 3 21:57:42 2003 UTC
# Line 4  Line 4 
4   * This file contains the DesignPattern::MVC class.   * This file contains the DesignPattern::MVC class.
5   *   *
6   * @author Andreas Motl <andreas.motl@ilo.de>   * @author Andreas Motl <andreas.motl@ilo.de>
7   * @package org.netfrag.glib   * @module DesignPattern::MVC
8     *
9   */   */
10    
11  /**  /**
12   * $Id$   * $Id$
13   *   *
14   * $Log$   * $Log$
15     * Revision 1.5  2003/03/03 21:57:42  joko
16     * changed base class
17     *
18   * Revision 1.4  2003/03/01 22:44:54  joko   * Revision 1.4  2003/03/01 22:44:54  joko
19   * setup_views not required?   * setup_views not required?
20   *   *
# Line 18  Line 22 
22   * now actually doing something via '->perform'   * now actually doing something via '->perform'
23   *   *
24   * Revision 1.2  2003/03/01 16:53:57  joko   * Revision 1.2  2003/03/01 16:53:57  joko
25   * + now propagating/forwarding passed-in data to add_[model|view|controller] to base class method DesignPattern::Container::__push_element to store it   * + now propagating/forwarding passed-in data to add_[model|view|controller] to base class method DesignPattern::Container::push_element to store it
26   *    is this a case for aspect-oriented-programming?   *    is this a case for aspect-oriented-programming?
27   * - removed calls to _abstract_method   * - removed calls to _abstract_method
28   *   *
# Line 41  Line 45 
45   * @license-url http://www.gnu.org/licenses/lgpl.txt   * @license-url http://www.gnu.org/licenses/lgpl.txt
46   *   *
47   * @package org.netfrag.glib   * @package org.netfrag.glib
48   * @module Application::ComponentRegistry   * @module DesignPattern::MVC
49   *   *
50   */   */
51    
# Line 55  Line 59 
59   */   */
60    
61    
62  // isn't required by now:  class DesignPattern_MVC extends DesignPattern_Facade {
 //loadModule('DesignPattern::Object');  
 //class DesignPattern_MVC extends DesignPattern_Object {  
   
 loadModule('DesignPattern::Container');  
 class DesignPattern_MVC extends DesignPattern_Container {  
63    
64    var $_model = array();    var $_model = array();
65    var $_view = array();    var $_view = array();
# Line 75  class DesignPattern_MVC extends DesignPa Line 74  class DesignPattern_MVC extends DesignPa
74    *    *
75    * @param registry    * @param registry
76    */    */
77    function DesignPattern_MVC() {    function constructor() {
78        parent::constructor();
79    }    }
80    
81    function _abstract_method($method) {    function _abstract_method($method) {
# Line 124  class DesignPattern_MVC extends DesignPa Line 124  class DesignPattern_MVC extends DesignPa
124    function setup_views() {    function setup_views() {
125      //$this->_abstract_method('setup_views');      //$this->_abstract_method('setup_views');
126    }    }
127        
128    
129    function add_model() {    function add_model() {
130      $args = &func_get_args();      $args = &func_get_args();
131      $this->__push('model', &$args[0]);      $this->_container->push('model', &$args[0]);
132    }    }
133    
134    function add_view() {    function add_view() {
135      $args = &func_get_args();      $args = &func_get_args();
136      $this->__push('view', &$args[0]);      $this->_container->push('view', &$args[0]);
137    }    }
138    
139    function add_controller() {    function add_controller() {
140      $args = &func_get_args();      $args = &func_get_args();
141      $this->__push('controller', &$args[0]);      $this->_container->push('controller', &$args[0]);
142    }    }
143    
144    function &get_model_data() {    function &get_model_data() {
145      return $this->__last('model');      return $this->_container->last('model');
146    }    }
147    
148    function &get_view_data() {    function &get_view_data() {
149      $args = &func_get_args();      $args = &func_get_args();
150      $slot = $args[0];      $slot = $args[0];
151      return $this->__slot('view', $slot);      return $this->_container->slot('view', $slot);
152    }    }
153    
154    function &get_controller_data() {    function &get_controller_data() {
155      return $this->__last('controller');      return $this->_container->last('controller');
156    }    }
157    
158  }  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

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