| 1 | <?php | 
| 2 |  | 
| 3 | /** | 
| 4 | * This file contains the DesignPattern::MVC class. | 
| 5 | * | 
| 6 | * @author Andreas Motl <andreas.motl@ilo.de> | 
| 7 | * @package org.netfrag.glib | 
| 8 | */ | 
| 9 |  | 
| 10 | /** | 
| 11 | * $Id: MVC.php,v 1.1 2003/03/01 15:31:18 joko Exp $ | 
| 12 | * | 
| 13 | * $Log: MVC.php,v $ | 
| 14 | * Revision 1.1  2003/03/01 15:31:18  joko | 
| 15 | * + initial commit | 
| 16 | * | 
| 17 | * | 
| 18 | */ | 
| 19 |  | 
| 20 |  | 
| 21 | /** | 
| 22 | * This tries to abstract some parts of the MVC Pattern. | 
| 23 | * | 
| 24 | * | 
| 25 | * @author Andreas Motl <andreas.motl@ilo.de> | 
| 26 | * @copyright (c) 2003 - All Rights reserved. | 
| 27 | * @license GNU LGPL (GNU Lesser General Public License) | 
| 28 | * | 
| 29 | * @author-url http://www.netfrag.org/~joko/ | 
| 30 | * @license-url http://www.gnu.org/licenses/lgpl.txt | 
| 31 | * | 
| 32 | * @package org.netfrag.glib | 
| 33 | * @module Application::ComponentRegistry | 
| 34 | * | 
| 35 | */ | 
| 36 |  | 
| 37 | /** | 
| 38 | * Todo: | 
| 39 | * | 
| 40 | *  o xyz | 
| 41 | *  o bla, bli, blub | 
| 42 | * | 
| 43 | * | 
| 44 | */ | 
| 45 |  | 
| 46 |  | 
| 47 | // isn't required by now: | 
| 48 | //loadModule('DesignPattern::Object'); | 
| 49 | //class DesignPattern_MVC extends DesignPattern_Object { | 
| 50 |  | 
| 51 | loadModule('DesignPattern::Container'); | 
| 52 | class DesignPattern_MVC extends DesignPattern_Container { | 
| 53 |  | 
| 54 | var $_model = NULL; | 
| 55 | var $_view = NULL; | 
| 56 | var $_controller = NULL; | 
| 57 |  | 
| 58 |  | 
| 59 | /** | 
| 60 | * The constructor ... | 
| 61 | *   ... just does nothing. | 
| 62 | * | 
| 63 | * @param registry | 
| 64 | */ | 
| 65 | function DesignPattern_MVC() { | 
| 66 | } | 
| 67 |  | 
| 68 | function _abstract_method($method) { | 
| 69 | $package = get_class($this); | 
| 70 | print "$package: Please implement method '$method'.<br/>"; | 
| 71 | } | 
| 72 |  | 
| 73 |  | 
| 74 |  | 
| 75 | function add_model() { | 
| 76 | $args = &func_get_args(); | 
| 77 | $this->__add_entity('model', &$args); | 
| 78 | } | 
| 79 |  | 
| 80 | function add_view() { | 
| 81 | $args = &func_get_args(); | 
| 82 | $this->__add_entity('view', &$args); | 
| 83 | } | 
| 84 |  | 
| 85 | function add_controller() { | 
| 86 | $args = &func_get_args(); | 
| 87 | $this->__add_entity('controller', &$args); | 
| 88 | } | 
| 89 |  | 
| 90 | function setup_views() { | 
| 91 | $this->_abstract_method('setup_views'); | 
| 92 | } | 
| 93 |  | 
| 94 | } | 
| 95 |  | 
| 96 | ?> |