Documentation is available at Validator.php
- <?php
- /**
- * MVCnPHP - Validator.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: Validator.class.php,v 1.3 2003/08/28 01:31:22 tony Exp $
- *
- */
- /**
- * MVC base command object
- */
- require_once 'BaseCommand.php';
- /**
- * MVC form object
- */
- require_once 'Form.php';
- /**
- * This is a validator class meant to ease the tasks
- * often done by validation logic
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @package net.geeklog.mvc
- *
- */
- class MVCnPHP_Validator extends MVCnPHP_BaseCommand {
- /**
- * @access private
- * @var object
- */
- private $form = null;
- /**
- * Constructor
- *
- * Initializes form object
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- *
- */
- public function __construct()
- {
- $this->_form = new MVCnPHP_Form($_REQUEST);
- }
- /**
- * Determines if the submitted form has a value for a given
- * variable name
- *
- * This is a simple pass thru to the form object
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @param string $varName Name of form variable
- * @return boolean True if found, otherwise false
- *
- */
- public function contains($varName)
- {
- return $this->_form->contains($varName);
- }
- /**
- * Gets value for given variable name
- *
- * This is a simple pass thru to the form object
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @param string $varName Name of form variable to get value for
- * @return variant Value of form variable
- *
- */
- public function get($varName)
- {
- return $this->_form->get($varName);
- }
- /**
- * Deletes a form variable
- *
- * This is a simple pass thru to the form object
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @param string $varName Name of form variable to delete
- *
- */
- public function remove($varName)
- {
- $this->_form->remove($varName);
- }
- /**
- * Sets a field to given value
- *
- * This is a simple pass thru to the form object
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @param string $varName Name of field to set
- * @param string $value Value to set field to
- *
- */
- public function set($varName, $value)
- {
- $this->_form->set($varName, $value);
- }
- /**
- * Returns value array
- *
- * This is a simple pass thru to the form object
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @return array Values array
- *
- */
- public function &getValues()
- {
- return $this->_form->getValues();
- }
- }
- ?>
Documentation generated on Mon, 7 Mar 2005 22:36:22 -0600 by phpDocumentor 1.3.0RC3