Documentation is available at ViewFactory.php
- <?php
- /**
- * MVCnPHP - ViewFactory.class.php
- *
- * This source file is subject to version 2.02 of the PHP license,
- * that is bundled with this package in the file LICENSE, and is
- * available at through the world-wide-web at
- * http://www.php.net/license/2_02.txt.
- * If you did not receive a copy of the PHP license and are unable to
- * obtain it through the world-wide-web, please send a note to
- * license@php.net so we can mail you a copy immediately.
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @copyright Tony Bibbs 2003
- * @package net.geeklog.mvc
- * @version $Id: ViewFactory.class.php,v 1.3 2004/03/23 02:39:35 tony Exp $
- *
- */
- /**
- * This implements the factory design pattern and is
- * responsible for building view objects
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @package net.geeklog.mvc
- *
- */
- class MVCnPHP_ViewFactory {
- /**
- * Builds the requested view object
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @param string $path Path to directory holding views
- * @param string $name Name of view to create
- * @return object viewobject
- *
- */
- public function &getView($path, $name)
- {
- $filename = $path . $name . '.php';
- if (file_exists($filename)) {
- require_once($filename);
- return new $name();
- } else {
- throw new Exception('Bad set of parameters to ViewFactory::getView');
- }
- }
- }
- ?>
Documentation generated on Mon, 7 Mar 2005 22:36:22 -0600 by phpDocumentor 1.3.0RC3