Class FormTagHelper

(line 32)

Description

AkActionViewHelper
   |
   --FormTagHelper

Located in File: /AkActionView/helpers/form_tag_helper.php

Provides a number of methods for creating form tags that doesn't rely on conventions with an object assigned to the template like FormHelper does. With the FormTagHelper, you provide the names and values yourself.

NOTE: The html options disabled, readonly, and multiple can all be treated as booleans. So specifying <tt>'disabled' => true</tt> will give <tt>disabled="disabled"</tt>.



Class Variables

Summary:

Class Constants

Summary:

Method Detail

Summary:
void check_box_tag ( $name, [ $value = '1'], [ $checked = false], [ $options = array()])
void end_form_tag ()
void file_field_tag ( $name, [ $options = array()])
void form_tag ([ $url_for_options = array()], [ $options = array()])
void hidden_field_tag ( $name, [ $value = null], [ $options = array()])
void image_submit_tag ( $source, [ $options = array()])
void password_field_tag ([ $name = 'password'], [ $value = null], [ $options = array()])
void radio_button_tag ( $name,  $value, [ $checked = false], [ $options = array()])
void select_tag ( $name, [ $option_tags = null], [ $options = array()])
void start_form_tag ([ $url_for_options = array()], [ $options = array()])
void submit_tag ([ $value = null], [ $options = array()])
void text_area_tag ( $name, [ $content = null], [ $options = array()])
void text_field_tag ( $name, [ $value = null], [ $options = array()])

Method check_box_tag (line 160)

void check_box_tag( $name, [ $value = '1'], [ $checked = false], [ $options = array()])

Creates a check box.

Parameters

  • $name:
  • $value:
  • $checked:
  • $options:

Info

Method end_form_tag (line 67)

void end_form_tag( )

Outputs '</form>'

Info

Method file_field_tag (line 125)

void file_field_tag( $name, [ $options = array()])

Creates a file upload field.

If you are using file uploads then you will also need to set the multipart option for the form: <?= $form_tag_helper->form_tag(array('action'=>'post'),array('multipart'=>true)); ?> <label for="file">File to Upload</label> <?= $form_tag_helper->file_field_tag('file'); ?> <?= $form_tag_helper->submit_tag(); ?> <?= $form_tag_helper->end_form_tag(); ?>

Parameters

  • $name:
  • $options:

Info

Method form_tag (line 43)

void form_tag( [ $url_for_options = array()], [ $options = array()])

Starts a form tag that points the action to an url configured with <tt>url_for_options</tt> just like $controller->urlFor. The method for the form defaults to POST.

Options: * <tt>'multipart'</tt> - If set to true, the enctype is set to "multipart/form-data". * <tt>'method'</tt> - The method to use when submitting the form, usually either "get" or "post".

Parameters

  • $url_for_options:
  • $options:

Info

Method hidden_field_tag (line 111)

void hidden_field_tag( $name, [ $value = null], [ $options = array()])

Creates a hidden field.

Takes the same options as text_field_tag

Parameters

  • $name:
  • $value:
  • $options:

Info

Method image_submit_tag (line 201)

void image_submit_tag( $source, [ $options = array()])

Displays an image which when clicked will submit the form.

<tt>source</tt> is passed to AssetTagHelper#image_path

Parameters

  • $source:
  • $options:

Info

Method password_field_tag (line 135)

void password_field_tag( [ $name = 'password'], [ $value = null], [ $options = array()])

Creates a password field.

Takes the same options as text_field_tag

Parameters

  • $name:
  • $value:
  • $options:

Info

Method radio_button_tag (line 172)

void radio_button_tag( $name, $value, [ $checked = false], [ $options = array()])

Creates a radio button.

Parameters

  • $name:
  • $value:
  • $checked:
  • $options:

Info

Method select_tag (line 86)

void select_tag( $name, [ $option_tags = null], [ $options = array()])

Creates a dropdown selection box, or if the <tt>'multiple'</tt> option is set to true, a multiple choice selection box.

Helpers::FormOptions can be used to create common select boxes such as countries, time zones, or associated records.

<tt>option_tags</tt> is a string containing the option tags for the select box:

  • Outputs <select id="people" name="people"><option>David</option></select>
$form_tag_helper->select_tag('people', '<option>David</option>');

Options: * <tt>'multiple'</tt> - If set to true the selection will allow multiple choices.

Parameters

  • $name:
  • $option_tags:
  • $options:

Info

Method start_form_tag (line 58)

void start_form_tag( [ $url_for_options = array()], [ $options = array()])

Parameters

  • $url_for_options:
  • $options:

Info

Method submit_tag (line 185)

void submit_tag( [ $value = null], [ $options = array()])

Creates a submit button with the text <tt>value</tt> as the caption. If options contains a pair with the key of "disable_with", then the value will be used to rename a disabled version of the submit button.

Parameters

  • $value:
  • $options:

Info

Method text_area_tag (line 148)

void text_area_tag( $name, [ $content = null], [ $options = array()])

Creates a text input area.

Options: * <tt>'size'</tt> - A string specifying the dimensions of the textarea.

  • Outputs <textarea name="body" id="body" cols="25" rows="10"></textarea>
<?= $form_tag_helper->text_area_tag('body', null, array('size'=>'25x10')); ?>

Parameters

  • $name:
  • $content:
  • $options:

Info

Method text_field_tag (line 101)

void text_field_tag( $name, [ $value = null], [ $options = array()])

Creates a standard text field.

Options: * <tt>'disabled'</tt> - If set to true, the user will not be able to use this input. * <tt>'size'</tt> - The number of visible characters that will fit in the input. * <tt>'maxlength'</tt> - The maximum number of characters that the browser will allow the user to enter.

An array of standard HTML options for the tag.

Parameters

  • $name:
  • $value:
  • $options:

Info

Inherited Variables

Inherited Class Variable Summary

Inherited From Class AkActionViewHelper

AkActionViewHelper::$locales_namespace -

Inherited Methods

Inherited Method Summary

Inherited From Class AkActionViewHelper

AkActionViewHelper::AkActionViewHelper() -

AkActionViewHelper::addObject() -

AkActionViewHelper::getObject() -

AkActionViewHelper::setController() -

AkActionViewHelper::t() -



Documentation generated on Sat, 20 Oct 2007 00:23:25 +0200 by phpDocumentor 1.3.2