Source for file form_tag_helper.php
Documentation is available at form_tag_helper.php
* File containing the FormTagHelper class and support functions
* @version $Id: form_tag_helper.php 228 2006-07-16 15:53:11Z john $
* @copyright (c) 2005 John Peterson
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* @todo Document this class
* @todo Document this method
function form_tag($url_for_options = array(), $options = array()) {
$html_options = array_merge(array("method" => "post"), $options);
&& $html_options['multipart']) {
$html_options['enctype'] = "multipart/form-data";
unset ($html_options['multipart']);
$html_options['action'] = url_for($url_for_options);
return $this->tag("form", $html_options, true);
* @todo Document this method
* @todo Document this method
function select_tag($name, $option_tags = null, $options = array()) {
$option_tags = implode('', $option_tags);
* @todo Document this method
return $this->tag("input", array_merge(array("type" => "text", "name" => $name, "id" => $name, "value" => $value), $this->convert_options($options)));
* @todo Document this method
* @todo Document this method
* @todo Document this method
* @todo Document this method
function text_area_tag($name, $content = null, $options = array()) {
$size = explode('x', $options["size"]);
$options["cols"] = reset($size);
$options["rows"] = end($size);
* @todo Document this method
function check_box_tag($name, $value = "1", $checked = false, $options = array()) {
$html_options = array_merge(array("type" => "checkbox", "name" => $name, "id" => $name, "value" => $value), $this->convert_options($options));
if ($checked) $html_options["checked"] = "checked";
return $this->tag("input", $html_options);
* @todo Document this method
function radio_button_tag($name, $value, $checked = false, $options = array()) {
$html_options = array_merge(array("type" => "radio", "name" => $name, "id" => $name, "value" => $value), $this->convert_options($options));
if ($checked) $html_options["checked"] = "checked";
return $this->tag("input", $html_options);
* @todo Document this method
function submit_tag($value = "Save changes", $options = array()) {
* @todo Document this method
return $this->tag("input",
"src" => image_path($source)),
* @todo Document this method
* Avialble functions for use in views
* @todo Document this method
* @todo Document this method
* @todo Document this method
* @todo Document this method
* @todo Document this method
* @todo Document this method
* @todo Document this method
* @todo Document this method
* @todo Document this method
* @todo Document this method
* @todo Document this method
* @todo Document this method
|