Documentation is available at Form.php
- <?php
- /**
- * MVCnPHP - Form.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: Form.class.php,v 1.3 2003/08/28 01:31:22 tony Exp $
- *
- */
- /**
- * This is a basic form class that can aid in form validation and
- * manipulation.
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @package net.geeklog.mvc
- *
- */
- class MVCnPHP_Form {
- /**
- * @access private
- * @var array
- */
- private $values = null;
- /**
- * Constructor
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @param array $formArray Array of form fieds (typical $_GET, $_POST or $_REQUEST)
- *
- */
- public function Form($formArray)
- {
- $this->values = $formArray;
- }
- /**
- * Returns if the given variable name exists in form
- *
- * @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 isset($this->values[$varName]);
- }
- /**
- * Gets value for given variable name
- *
- * @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)
- {
- if (!$this->contains($varName)) {
- return null;
- }
- return $this->values[$varName];
- }
- /**
- * Deletes a form variable
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @param string $varName Name of form variable to delete
- *
- */
- public function remove($varName)
- {
- if ($this->contains($varName)) {
- unset($this->values[$varName]);
- }
- }
- /**
- * Sets a field to given value
- *
- * @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->values[$varName] = $value;
- }
- /**
- * Returns value array
- *
- * @author Tony Bibbs <tony@geeklog.net>
- * @access public
- * @return array Values array
- *
- */
- public function &getValues()
- {
- return $this->values;
- }
- }
- ?>
Documentation generated on Mon, 7 Mar 2005 22:36:21 -0600 by phpDocumentor 1.3.0RC3