[geeklog-cvs] MVCnPHP QF_View.class.php,NONE,1.1
geeklog-cvs-admin at lists.geeklog.net
geeklog-cvs-admin at lists.geeklog.net
Tue Apr 8 17:44:34 EDT 2003
Update of /usr/cvs/geeklog/MVCnPHP
In directory internal.geeklog.net:/tmp/cvs-serv8902
Added Files:
QF_View.class.php
Log Message:
Initial Release. This class adds PEAR::HTML_QuickForm Support into this MVC package. Be sure to read the docs on this file if you decide to use it.
--- NEW FILE: QF_View.class.php ---
<?php
/**
* MVCnPHP - QF_View.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 at php.net so we can mail you a copy immediately.
*
* @author Tony Bibbs <tony at geeklog.net>
* @copyright Tony Bibbs 2003
* @package net.geeklog.mvc
* @version $Id: QF_View.class.php,v 1.1 2003/04/08 21:44:32 tony Exp $
*
*/
/**
* Abstract view class
*/
require 'BaseView.class.php';
/**
* PEAR::HTML_QuickForm
*/
require 'HTML/QuickForm.php';
/**
* This view uses PEAR::HTML_QuickForm to show and validate
* HTML forms.
*
* NOTE: if you use this class you will need to set
* Controller::setViewDir() and Controller::setCommandDir()
* to the same directory lest you want to duplicate code.
*
* @author Tony Bibbs <tony at geeklog.net>
* @package net.geeklog.mvc
*
*/
class QF_View extends BaseView {
/**
* @access private
* @var HTML_QuickForm
*/
var $_QForm = null;
/**
* Constructor for QF_View class
*
* Instantiates an HTML_QuickForm object
*
* @author Tony Bibbs <tony at geeklog.net>
* @access public
*
*/
function QF_View()
{
$this->_QForm = new HTML_QuickForm();
}
/**
* This is a way to get around the fact you don't get to send arguments
* to HTML_QuickForm's constructor. You will probably call this from
* getView()
*
* @author Tony Bibbs <tony at geeklog.net>
* @access private
*
*/
function _setQFormAttributes($formName='', $method='post', $action='')
{
$this->_QForm->HTML_QuickForm($formName, $method, $action);
}
/**
* This method is where you would put the code to have HTML_QuickForm display
* the form
*
* @author Tony Bibbs <tony at geeklog.net>
* @access public
*
*/
function getView()
{
}
/**
* This method fools MVC into thinking this view is also able to validate
*
* This is where you would add your validatation logic.
*
* @author Tony Bibbs <tony at geeklog.net>
* @access public
*
*/
function execute()
{
}
}
More information about the geeklog-cvs
mailing list