Location: PHPKode > projects > PHP on Trax > johnpipi-trax-f599562/trax/doc/__filesource/fsource_PHPonTrax__vendortraxaction_viewhelpersform_helper.php.html
<html>
<head>
<title>File Source for form_helper.php</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">PHPonTrax</td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
  		  [ <a href="../classtrees_PHPonTrax.html" class="menu">class tree: PHPonTrax</a> ]
		  [ <a href="../elementindex_PHPonTrax.html" class="menu">index: PHPonTrax</a> ]
		  [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
      <b>Packages:</b><br />
              <a href="../li_PHPonTrax.html">PHPonTrax</a><br />
              <a href="../li_PHPonTraxTest.html">PHPonTraxTest</a><br />
            <br /><br />
                  
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file form_helper.php</h1>
<p>Documentation is available at <a href="../PHPonTrax/_vendor_trax_action_view_helpers_form_helper_php.html">form_helper.php</a></p>
<div class="php">
<div class="listing"><pre><ol><li><a name="a1"></a><span class="src-php">&lt;?php</span></li>
<li><a name="a2"></a><span class="src-doc">/**</span></li>
<li><a name="a3"></a><span class="src-doc"> *  File containing the FormHelper class</span></li>
<li><a name="a4"></a><span class="src-doc"> *</span></li>
<li><a name="a5"></a><span class="src-doc"> *  (PHP 5)</span></li>
<li><a name="a6"></a><span class="src-doc"> *</span></li>
<li><a name="a7"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@package</span><span class="src-doc"> PHPonTrax</span></li>
<li><a name="a8"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@version</span><span class="src-doc"> $Id$</span></li>
<li><a name="a9"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@copyright</span><span class="src-doc"> (c) 2005 John Peterson</span></li>
<li><a name="a10"></a><span class="src-doc"> *</span></li>
<li><a name="a11"></a><span class="src-doc"> *   Permission is hereby granted, free of charge, to any person obtaining</span></li>
<li><a name="a12"></a><span class="src-doc"> *   a copy of this software and associated documentation files (the</span></li>
<li><a name="a13"></a><span class="src-doc"> *   &quot;Software&quot;), to deal in the Software without restriction, including</span></li>
<li><a name="a14"></a><span class="src-doc"> *   without limitation the rights to use, copy, modify, merge, publish,</span></li>
<li><a name="a15"></a><span class="src-doc"> *   distribute, sublicense, and/or sell copies of the Software, and to</span></li>
<li><a name="a16"></a><span class="src-doc"> *   permit persons to whom the Software is furnished to do so, subject to</span></li>
<li><a name="a17"></a><span class="src-doc"> *   the following conditions:</span></li>
<li><a name="a18"></a><span class="src-doc"> *</span></li>
<li><a name="a19"></a><span class="src-doc"> *   The above copyright notice and this permission notice shall be</span></li>
<li><a name="a20"></a><span class="src-doc"> *   included in all copies or substantial portions of the Software.</span></li>
<li><a name="a21"></a><span class="src-doc"> *</span></li>
<li><a name="a22"></a><span class="src-doc"> *   THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,</span></li>
<li><a name="a23"></a><span class="src-doc"> *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF</span></li>
<li><a name="a24"></a><span class="src-doc"> *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND</span></li>
<li><a name="a25"></a><span class="src-doc"> *   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE</span></li>
<li><a name="a26"></a><span class="src-doc"> *   LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION</span></li>
<li><a name="a27"></a><span class="src-doc"> *   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION</span></li>
<li><a name="a28"></a><span class="src-doc"> *   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span></li>
<li><a name="a29"></a><span class="src-doc"> */</span></li>
<li><a name="a30"></a>&nbsp;</li>
<li><a name="a31"></a><span class="src-doc">/**</span></li>
<li><a name="a32"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> Document this class</span></li>
<li><a name="a33"></a><span class="src-doc"> */</span></li>
<li><a name="a34"></a><span class="src-key">class </span><a href="../PHPonTrax/FormHelper.html">FormHelper</a> <span class="src-key">extends </span><a href="../PHPonTrax/Helpers.html">Helpers</a> <span class="src-sym">{</span></li>
<li><a name="a35"></a>&nbsp;</li>
<li><a name="a36"></a>    <span class="src-doc">/**</span></li>
<li><a name="a37"></a><span class="src-doc">     *  Default attributes for input fields</span></li>
<li><a name="a38"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string[] </span></li>
<li><a name="a39"></a><span class="src-doc">     */</span></li>
<li><a name="a40"></a>    <span class="src-key">private </span><a href="../PHPonTrax/FormHelper.html#var$default_field_options">$default_field_options</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a41"></a>&nbsp;</li>
<li><a name="a42"></a>    <span class="src-doc">/**</span></li>
<li><a name="a43"></a><span class="src-doc">     *  Default attributes for radio buttons</span></li>
<li><a name="a44"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string[] </span></li>
<li><a name="a45"></a><span class="src-doc">     */</span></li>
<li><a name="a46"></a>    <span class="src-key">private </span><a href="../PHPonTrax/FormHelper.html#var$default_radio_options">$default_radio_options</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a47"></a>&nbsp;</li>
<li><a name="a48"></a>    <span class="src-doc">/**</span></li>
<li><a name="a49"></a><span class="src-doc">     *  Default attributes for text areas</span></li>
<li><a name="a50"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string[] </span></li>
<li><a name="a51"></a><span class="src-doc">     */</span></li>
<li><a name="a52"></a>    <span class="src-key">private </span><a href="../PHPonTrax/FormHelper.html#var$default_text_area_options">$default_text_area_options</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a53"></a>&nbsp;</li>
<li><a name="a54"></a>    <span class="src-doc">/**</span></li>
<li><a name="a55"></a><span class="src-doc">     *  Default attributes for dates</span></li>
<li><a name="a56"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@var </span><span class="src-doc-type">string[] </span></li>
<li><a name="a57"></a><span class="src-doc">     */</span></li>
<li><a name="a58"></a>    <span class="src-key">private </span><a href="../PHPonTrax/FormHelper.html#var$default_date_options">$default_date_options</a> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a59"></a>&nbsp;</li>
<li><a name="a60"></a>    <span class="src-doc">/**</span></li>
<li><a name="a61"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> Document this method</span></li>
<li><a name="a62"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> default_date_options</span></li>
<li><a name="a63"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> default_field_options</span></li>
<li><a name="a64"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> default_radio_options</span></li>
<li><a name="a65"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@uses</span><span class="src-doc"> default_text_area_options</span></li>
<li><a name="a66"></a><span class="src-doc">     */</span></li>
<li><a name="a67"></a>    <span class="src-key">function </span><a href="../PHPonTrax/FormHelper.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-var">$object_name</span><span class="src-sym">, </span><span class="src-var">$attribute_name</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a68"></a>        <span class="src-id">parent</span><span class="src-sym">::</span><a href="../PHPonTrax/Helpers.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-var">$object_name</span><span class="src-sym">, </span><span class="src-var">$attribute_name</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a69"></a>&nbsp;</li>
<li><a name="a70"></a>        <span class="src-comm">//  Set default attributes for input fields</span></li>
<li><a name="a71"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#var$default_field_options">default_field_options</a> = </li>
<li><a name="a72"></a>            <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'DEFAULT_FIELD_OPTIONS'</span><span class="src-sym">,</span><span class="src-var">$GLOBALS</span><span class="src-sym">)</span></li>
<li><a name="a73"></a>            ? <span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'DEFAULT_FIELD_OPTIONS'</span><span class="src-sym">]</span></li>
<li><a name="a74"></a>            : <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">&quot;size&quot; </span>=&gt; <span class="src-num">30</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a75"></a>&nbsp;</li>
<li><a name="a76"></a>        <span class="src-comm">//  Set default attributes for radio buttons</span></li>
<li><a name="a77"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#var$default_radio_options">default_radio_options</a> =</li>
<li><a name="a78"></a>            <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'DEFAULT_RADIO_OPTIONS'</span><span class="src-sym">,</span><span class="src-var">$GLOBALS</span><span class="src-sym">)</span></li>
<li><a name="a79"></a>            ? <span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'DEFAULT_RADIO_OPTIONS'</span><span class="src-sym">]</span></li>
<li><a name="a80"></a>            : <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a81"></a>&nbsp;</li>
<li><a name="a82"></a>        <span class="src-comm">//  Set default attributes for text areas</span></li>
<li><a name="a83"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#var$default_text_area_options">default_text_area_options</a> =</li>
<li><a name="a84"></a>            <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'DEFAULT_TEXT_AREA_OPTIONS'</span><span class="src-sym">,</span><span class="src-var">$GLOBALS</span><span class="src-sym">)</span></li>
<li><a name="a85"></a>            ? <span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'DEFAULT_TEXT_AREA_OPTIONS'</span><span class="src-sym">]</span></li>
<li><a name="a86"></a>            : <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">&quot;cols&quot; </span>=&gt; <span class="src-num">40</span><span class="src-sym">, </span><span class="src-str">&quot;rows&quot; </span>=&gt; <span class="src-num">20</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a87"></a>&nbsp;</li>
<li><a name="a88"></a>        <span class="src-comm">//  Set default attributes for dates</span></li>
<li><a name="a89"></a>        <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#var$default_date_options">default_date_options</a> =</li>
<li><a name="a90"></a>            <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'DEFAULT_Date_OPTIONS'</span><span class="src-sym">,</span><span class="src-var">$GLOBALS</span><span class="src-sym">)</span></li>
<li><a name="a91"></a>            ? <span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'DEFAULT_DATE_OPTIONS'</span><span class="src-sym">]</span></li>
<li><a name="a92"></a>            : <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">&quot;:discard_type&quot; </span>=&gt; <span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a93"></a>    <span class="src-sym">}</span></li>
<li><a name="a94"></a>&nbsp;</li>
<li><a name="a95"></a>    <span class="src-doc">/**</span></li>
<li><a name="a96"></a><span class="src-doc">     *  </span><span class="src-doc-coretag">@todo</span><span class="src-doc"> Document this method</span></li>
<li><a name="a97"></a><span class="src-doc">     */</span></li>
<li><a name="a98"></a>    <span class="src-key">function </span><a href="../PHPonTrax/FormHelper.html#methodtag_name">tag_name</a><span class="src-sym">(</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a99"></a>        <span class="src-key">return </span><span class="src-str">&quot;</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">}</span><span class="src-sym">[</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">}</span><span class="src-sym">]<span class="src-str"></span><span class="src-str">"</span><span class="src-sym">;</span></span></li>
<li><a name="a100"></a><span class="src-str">    <span class="src-sym">}</span></span></li>
<li><a name="a101"></a>&nbsp;</li>
<li><a name="a102"></a><span class="src-str">    /**</span></li>
<li><a name="a103"></a><span class="src-str">     *  @todo Document this method</span></li>
<li><a name="a104"></a><span class="src-str">     */</span></li>
<li><a name="a105"></a><span class="src-str">    <span class="src-key">function</span> <span class="src-id">tag_name_with_index</span><span class="src-sym">(</span><span class="src-var">$index</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a106"></a><span class="src-str">        <span class="src-key">return</span> <span class="src-str">"</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">}</span><span class="src-sym">[</span>{<span class="src-var">$index<span class="src-str"></span><span class="src-sym">}</span><span class="src-sym">]</span><span class="src-sym">[</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">}</span><span class="src-sym">]<span class="src-str"></span><span class="src-str">"</span><span class="src-sym">;</span></span></li>
<li><a name="a107"></a><span class="src-str">    <span class="src-sym">}</span></span></li>
<li><a name="a108"></a>&nbsp;</li>
<li><a name="a109"></a><span class="src-str">    /**</span></li>
<li><a name="a110"></a><span class="src-str">     *  @todo Document this method</span></li>
<li><a name="a111"></a><span class="src-str">     */</span></li>
<li><a name="a112"></a><span class="src-str">    <span class="src-key">function</span> <span class="src-id">tag_id</span><span class="src-sym">(</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a113"></a><span class="src-str">        <span class="src-key">return</span> <span class="src-str">"</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">}</span><span class="src-id">_</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">}<span class="src-str"></span><span class="src-str">"</span><span class="src-sym">;</span></span></li>
<li><a name="a114"></a><span class="src-str">    <span class="src-sym">}</span></span></li>
<li><a name="a115"></a>&nbsp;</li>
<li><a name="a116"></a><span class="src-str">    /**</span></li>
<li><a name="a117"></a><span class="src-str">     *  @todo Document this method</span></li>
<li><a name="a118"></a><span class="src-str">     */</span></li>
<li><a name="a119"></a><span class="src-str">    <span class="src-key">function</span> <span class="src-id">tag_id_with_index</span><span class="src-sym">(</span><span class="src-var">$index</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a120"></a><span class="src-str">        <span class="src-key">return</span> <span class="src-str">"</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">}</span><span class="src-id">_</span>{<span class="src-var">$index<span class="src-str"></span><span class="src-sym">}</span><span class="src-id">_</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">}<span class="src-str"></span><span class="src-str">"</span><span class="src-sym">;</span></span></li>
<li><a name="a121"></a><span class="src-str">    <span class="src-sym">}</span></span></li>
<li><a name="a122"></a>&nbsp;</li>
<li><a name="a123"></a><span class="src-str">    /**</span></li>
<li><a name="a124"></a><span class="src-str">     *  @todo Document this method</span></li>
<li><a name="a125"></a><span class="src-str">     *  @param string[]</span></li>
<li><a name="a126"></a><span class="src-str">     *  @uses auto_index</span></li>
<li><a name="a127"></a><span class="src-str">     *  @uses tag_id</span></li>
<li><a name="a128"></a><span class="src-str">     *  @uses tag_name</span></li>
<li><a name="a129"></a><span class="src-str">     *  @uses tag_id_with_index()</span></li>
<li><a name="a130"></a><span class="src-str">     *  @uses tag_name_with_index()</span></li>
<li><a name="a131"></a><span class="src-str">     */</span></li>
<li><a name="a132"></a><span class="src-str">    <span class="src-key">function</span> <span class="src-id">add_default_name_and_id</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span> <span class="src-sym">{</span>      </span></li>
<li><a name="a133"></a><span class="src-str">           <span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">&quot;index&quot;</span><span class="src-sym">,</span> <span class="src-var">$options</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a134"></a><span class="src-str">            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;name&quot;</span><span class="src-sym">]</span> = <span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">&quot;name&quot;</span><span class="src-sym">,</span> <span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a135"></a><span class="src-str">                ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;name&quot;</span><span class="src-sym">]</span></span></li>
<li><a name="a136"></a><span class="src-str">                : <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methodtag_name_with_index">tag_name_with_index</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;index&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a137"></a>            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;id&quot;</span><span class="src-sym">] </span>= <span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">&quot;id&quot;</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a138"></a>                ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;id&quot;</span><span class="src-sym">]</span></li>
<li><a name="a139"></a>                : <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methodtag_id_with_index">tag_id_with_index</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;index&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a140"></a>            unset<span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;index&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a141"></a>        <span class="src-str"><span class="src-sym">}</span> <span class="src-key">elseif</span><span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$auto_index">auto_index</a><span class="src-sym">) <span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a142"></a><span class="src-str">            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;name&quot;</span><span class="src-sym">]</span> = <span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">&quot;name&quot;</span><span class="src-sym">,</span> <span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a143"></a><span class="src-str">                ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;name&quot;</span><span class="src-sym">]</span></span></li>
<li><a name="a144"></a><span class="src-str">                : <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methodtag_name_with_index">tag_name_with_index</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$auto_index">auto_index</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a145"></a>            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;id&quot;</span><span class="src-sym">] </span>= <span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">&quot;id&quot;</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a146"></a>                ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;id&quot;</span><span class="src-sym">]</span></li>
<li><a name="a147"></a>                : <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methodtag_id_with_index">tag_id_with_index</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$auto_index">auto_index</a><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a148"></a>        <span class="src-str"><span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span></span></li>
<li><a name="a149"></a><span class="src-str">            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;name&quot;</span><span class="src-sym">]</span> = <span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">&quot;name&quot;</span><span class="src-sym">,</span> <span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a150"></a><span class="src-str">                ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;name&quot;</span><span class="src-sym">]</span></span></li>
<li><a name="a151"></a><span class="src-str">                : <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methodtag_name">tag_name</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a152"></a>            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;id&quot;</span><span class="src-sym">] </span>= <span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">&quot;id&quot;</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a153"></a>                ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;id&quot;</span><span class="src-sym">]</span></li>
<li><a name="a154"></a>                : <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methodtag_id">tag_id</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a155"></a>        <span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a156"></a><span class="src-str">        <span class="src-key">return</span> <span class="src-var">$options</span><span class="src-sym">;</span></span></li>
<li><a name="a157"></a><span class="src-str">    <span class="src-sym">}</span></span></li>
<li><a name="a158"></a>&nbsp;</li>
<li><a name="a159"></a><span class="src-str">    /**</span></li>
<li><a name="a160"></a><span class="src-str">     *  Generate an HTML or XML input tag with optional attributes</span></li>
<li><a name="a161"></a><span class="src-str">     *</span></li>
<li><a name="a162"></a><span class="src-str">     *  @param string  Type of input field (&lt;samp&gt;'text'&lt;/samp&gt;,</span></li>
<li><a name="a163"></a><span class="src-str">     *                 &lt;samp&gt;'password'&lt;/samp&gt;, &lt;samp&gt;'hidden'&lt;/samp&gt;</span></li>
<li><a name="a164"></a><span class="src-str">     *                 &lt;i&gt;etc.&lt;/i&gt;)</span></li>
<li><a name="a165"></a><span class="src-str">     *  @param string[] Attributes to apply to the input tag:&lt;br&gt;</span></li>
<li><a name="a166"></a><span class="src-str">     *    &lt;samp&gt;array('attr1' =&gt; 'value1'[, 'attr2' =&gt; 'value2']...)&lt;/samp&gt;</span></li>
<li><a name="a167"></a><span class="src-str">     *  @return string</span></li>
<li><a name="a168"></a><span class="src-str">     *   &lt;samp&gt;&lt;input type=&quot;&lt;/samp&gt;&lt;i&gt;type&lt;/i&gt;</span></li>
<li><a name="a169"></a><span class="src-str">     *   &lt;samp&gt;&quot; maxlength=&quot;&lt;/samp&gt;&lt;i&gt;maxlength&lt;/i&gt;&lt;samp&gt;&quot; .../&gt;\n&lt;/samp&gt;</span></li>
<li><a name="a170"></a><span class="src-str">     *  @uses add_default_name_and_id()</span></li>
<li><a name="a171"></a><span class="src-str">     *  @uses attribute_name</span></li>
<li><a name="a172"></a><span class="src-str">     *  @uses error_wrapping</span></li>
<li><a name="a173"></a><span class="src-str">     *  @uses default_field_options</span></li>
<li><a name="a174"></a><span class="src-str">     *  @uses object()</span></li>
<li><a name="a175"></a><span class="src-str">     *  @uses tag()</span></li>
<li><a name="a176"></a><span class="src-str">     *  @uses value()</span></li>
<li><a name="a177"></a><span class="src-str">     */</span></li>
<li><a name="a178"></a><span class="src-str">    <span class="src-key">function</span> <span class="src-id">to_input_field_tag</span><span class="src-sym">(</span><span class="src-var">$field_type</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a179"></a><span class="src-str">        <span class="src-var">$default_size</span> = <span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">&quot;maxlength&quot;</span><span class="src-sym">,</span> <span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a180"></a><span class="src-str">            ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;maxlength&quot;</span><span class="src-sym">]</span> : <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#var$default_field_options">default_field_options</a><span class="src-sym">[</span><span class="src-str">'size'</span><span class="src-sym">]</span><span class="src-sym">;</span></li>
<li><a name="a181"></a>        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;size&quot;</span><span class="src-sym">] </span>= <span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">&quot;size&quot;</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span></li>
<li><a name="a182"></a>            ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;size&quot;</span><span class="src-sym">]</span>: <span class="src-var">$default_size</span><span class="src-sym">;</span></li>
<li><a name="a183"></a>        <span class="src-var">$options </span>= <span class="src-id">array_merge</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#var$default_field_options">default_field_options</a><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a184"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$field_type </span>== <span class="src-str">&quot;hidden&quot;</span><span class="src-sym">) <span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a185"></a><span class="src-str">            unset<span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;size&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a186"></a><span class="src-str">        <span class="src-sym">}</span></span></li>
<li><a name="a187"></a><span class="src-str">        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;type&quot;</span><span class="src-sym">]</span> = <span class="src-var">$field_type</span><span class="src-sym">;</span></span></li>
<li><a name="a188"></a><span class="src-str">        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$field_type</span> != <span class="src-str">&quot;file&quot;</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a189"></a><span class="src-str">            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;value&quot;</span><span class="src-sym">]</span> = <span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">&quot;value&quot;</span><span class="src-sym">,</span> <span class="src-var">$options</span><span class="src-sym">)</span></span></li>
<li><a name="a190"></a><span class="src-str">                ? <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;value&quot;</span><span class="src-sym">]</span> : <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a191"></a>        <span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a192"></a><span class="src-str">        <span class="src-var">$options</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methodadd_default_name_and_id">add_default_name_and_id</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a193"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methoderror_wrapping">error_wrapping</a><span class="src-sym">(</span></li>
<li><a name="a194"></a>                     <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodtag">tag</a><span class="src-sym">(</span><span class="src-str">&quot;input&quot;</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a195"></a>                     <span class="src-sym">@</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">,</span></li>
<li><a name="a196"></a>                                      <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodobject">object</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">errors</span><span class="src-sym">)</span></li>
<li><a name="a197"></a>                     ? <span class="src-id">true </span>: <span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a198"></a>    <span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a199"></a>&nbsp;</li>
<li><a name="a200"></a><span class="src-str">    /**</span></li>
<li><a name="a201"></a><span class="src-str">     *  @todo Document this method</span></li>
<li><a name="a202"></a><span class="src-str">     *  @uses add_default_name_and_id()</span></li>
<li><a name="a203"></a><span class="src-str">     */</span></li>
<li><a name="a204"></a><span class="src-str">    <span class="src-key">function</span> <span class="src-id">to_radio_button_tag</span><span class="src-sym">(</span><span class="src-var">$tag_value</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a205"></a><span class="src-str">        <span class="src-var">$options</span> = <span class="src-id">array_merge</span><span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#var$default_radio_options">default_radio_options</a><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a206"></a>        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;type&quot;</span><span class="src-sym">] </span>= <span class="src-str">&quot;radio&quot;</span><span class="src-sym">;</span></li>
<li><a name="a207"></a>        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;value&quot;</span><span class="src-sym">] </span>= <span class="src-var">$tag_value</span><span class="src-sym">;</span></li>
<li><a name="a208"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">) </span>== <span class="src-var">$tag_value</span><span class="src-sym">) <span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a209"></a><span class="src-str">            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;checked&quot;</span><span class="src-sym">]</span> = <span class="src-str">&quot;checked&quot;</span><span class="src-sym">;</span></span></li>
<li><a name="a210"></a><span class="src-str">        <span class="src-sym">}</span></span></li>
<li><a name="a211"></a><span class="src-str">        <span class="src-var">$pretty_tag_value</span> = <span class="src-id">preg_replace</span><span class="src-sym">(</span><span class="src-str">'/\s/'</span><span class="src-sym">,</span> <span class="src-str">&quot;_&quot;</span><span class="src-sym">,</span> <span class="src-id">preg_replace</span><span class="src-sym">(</span><span class="src-str">'/\W/'</span><span class="src-sym">,</span> <span class="src-str">&quot;&quot;</span><span class="src-sym">,</span> <span class="src-id">strtolower</span><span class="src-sym">(</span><span class="src-var">$tag_value</span><span class="src-sym">)))</span><span class="src-sym">;</span></span></li>
<li><a name="a212"></a><span class="src-str">        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;id&quot;</span><span class="src-sym">]</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$auto_index">auto_index</a> ?</li>
<li><a name="a213"></a>            <span class="src-str"><span class="src-str">"</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">}</span><span class="src-id">_</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$auto_index">auto_index</a><span class="src-sym">}</span><span class="src-id">_</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">}</span><span class="src-id">_</span>{<span class="src-var">$pretty_tag_value<span class="src-str"></span><span class="src-sym">}</span><span class="src-str">"</span> :</span></li>
<li><a name="a214"></a><span class="src-str">            <span class="src-str">"</span></span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$object_name">object_name</a><span class="src-sym">}</span><span class="src-id">_</span>{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">}</span><span class="src-id">_</span>{<span class="src-var">$pretty_tag_value<span class="src-str"></span><span class="src-sym">}</span><span class="src-str">"</span><span class="src-sym">;</span></span></li>
<li><a name="a215"></a><span class="src-str">        <span class="src-var">$options</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methodadd_default_name_and_id">add_default_name_and_id</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a216"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methoderror_wrapping">error_wrapping</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodtag">tag</a><span class="src-sym">(</span><span class="src-str">&quot;input&quot;</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodobject">object</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">errors</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a217"></a>    <span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a218"></a>&nbsp;</li>
<li><a name="a219"></a><span class="src-str">    /**</span></li>
<li><a name="a220"></a><span class="src-str">     *  @todo Document this method</span></li>
<li><a name="a221"></a><span class="src-str">     *  @uses add_default_name_and_id()</span></li>
<li><a name="a222"></a><span class="src-str">     */</span></li>
<li><a name="a223"></a><span class="src-str">    <span class="src-key">function</span> <span class="src-id">to_text_area_tag</span><span class="src-sym">(</span><span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a224"></a><span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-str">&quot;size&quot;</span><span class="src-sym">,</span> <span class="src-var">$options</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a225"></a><span class="src-str">            <span class="src-var">$size</span> = <span class="src-id">explode</span><span class="src-sym">(</span><span class="src-str">'x'</span><span class="src-sym">,</span> <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;size&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a226"></a><span class="src-str">            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;cols&quot;</span><span class="src-sym">]</span> = <span class="src-id">reset</span><span class="src-sym">(</span><span class="src-var">$size</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a227"></a><span class="src-str">            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;rows&quot;</span><span class="src-sym">]</span> = <span class="src-id">end</span><span class="src-sym">(</span><span class="src-var">$size</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a228"></a><span class="src-str">            unset<span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;size&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a229"></a><span class="src-str">        <span class="src-sym">}</span></span></li>
<li><a name="a230"></a><span class="src-str">        <span class="src-var">$options</span> = <span class="src-id">array_merge</span><span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#var$default_text_area_options">default_text_area_options</a><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a231"></a>        <span class="src-var">$options </span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methodadd_default_name_and_id">add_default_name_and_id</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a232"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methoderror_wrapping">error_wrapping</a><span class="src-sym">(</span></li>
<li><a name="a233"></a>           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodcontent_tag">content_tag</a><span class="src-sym">(</span><span class="src-str">&quot;textarea&quot;</span><span class="src-sym">,</span></li>
<li><a name="a234"></a>                              <span class="src-id">htmlspecialchars</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">,</span></li>
<li><a name="a235"></a>                              <span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a236"></a>           <span class="src-id">array_key_exists</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodobject">object</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">errors</span><span class="src-sym">)</span></li>
<li><a name="a237"></a>           ? <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodobject">object</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">errors</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">] </span>: <span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a238"></a>    <span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a239"></a>&nbsp;</li>
<li><a name="a240"></a><span class="src-str">    /**</span></li>
<li><a name="a241"></a><span class="src-str">     *  @todo Document this method</span></li>
<li><a name="a242"></a><span class="src-str">     *  @uses add_default_name_and_id()</span></li>
<li><a name="a243"></a><span class="src-str">     */</span></li>
<li><a name="a244"></a><span class="src-str">    <span class="src-key">function</span> <span class="src-id">to_check_box_tag</span><span class="src-sym">(</span><span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$checked_value</span> = <span class="src-str">&quot;1&quot;</span><span class="src-sym">,</span> <span class="src-var">$unchecked_value</span> = <span class="src-str">&quot;0&quot;</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a245"></a><span class="src-str">        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;type&quot;</span><span class="src-sym">]</span> = <span class="src-str">&quot;checkbox&quot;</span><span class="src-sym">;</span></span></li>
<li><a name="a246"></a><span class="src-str">        <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;value&quot;</span><span class="src-sym">]</span> = <span class="src-var">$checked_value</span><span class="src-sym">;</span></span></li>
<li><a name="a247"></a><span class="src-str">        <span class="src-key">switch</span><span class="src-sym">(</span><span class="src-id">gettype</span><span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">))) <span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a248"></a><span class="src-str">            <span class="src-key">case</span> <span class="src-str">'boolean'</span>:</span></li>
<li><a name="a249"></a><span class="src-str">                <span class="src-var">$checked</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a250"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a251"></a>            <span class="src-key">case </span><span class="src-str">'NULL'</span>:</li>
<li><a name="a252"></a>                <span class="src-var">$checked </span>= <span class="src-id">false</span><span class="src-sym">;</span></li>
<li><a name="a253"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a254"></a>            <span class="src-key">case </span><span class="src-str">'integer'</span>:</li>
<li><a name="a255"></a>                <span class="src-var">$checked </span>= <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">) </span>!= <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a256"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a257"></a>            <span class="src-key">case </span><span class="src-str">'string'</span>:</li>
<li><a name="a258"></a>                <span class="src-var">$checked </span>= <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">) </span>== <span class="src-var">$checked_value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a259"></a>                <span class="src-key">break</span><span class="src-sym">;</span></li>
<li><a name="a260"></a>            <span class="src-key">default</span>:</li>
<li><a name="a261"></a>                <span class="src-var">$checked </span>= <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">) </span>!= <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a262"></a>        <span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a263"></a>&nbsp;</li>
<li><a name="a264"></a><span class="src-str">        <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$checked</span> || <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;checked&quot;</span><span class="src-sym">]</span> == <span class="src-str">&quot;checked&quot;</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a265"></a><span class="src-str">            <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;checked&quot;</span><span class="src-sym">]</span> = <span class="src-str">&quot;checked&quot;</span><span class="src-sym">;</span></span></li>
<li><a name="a266"></a><span class="src-str">        <span class="src-sym">}</span> <span class="src-key">else</span> <span class="src-sym">{</span></span></li>
<li><a name="a267"></a><span class="src-str">            unset<span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;checked&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a268"></a><span class="src-str">        <span class="src-sym">}</span></span></li>
<li><a name="a269"></a>&nbsp;</li>
<li><a name="a270"></a><span class="src-str">        <span class="src-var">$options</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methodadd_default_name_and_id">add_default_name_and_id</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a271"></a>        <span class="src-key">return </span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methoderror_wrapping">error_wrapping</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodtag">tag</a><span class="src-sym">(</span><span class="src-str">&quot;input&quot;</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">) </span>. <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodtag">tag</a><span class="src-sym">(</span><span class="src-str">&quot;input&quot;</span><span class="src-sym">, </span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">&quot;name&quot; </span>=&gt; <span class="src-var">$options</span><span class="src-sym">[</span><span class="src-str">&quot;name&quot;</span><span class="src-sym">]</span><span class="src-sym">, </span><span class="src-str">&quot;type&quot; </span>=&gt; <span class="src-str">&quot;hidden&quot;</span><span class="src-sym">, </span><span class="src-str">&quot;value&quot; </span>=&gt; <span class="src-var">$unchecked_value</span><span class="src-sym">))</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodobject">object</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">errors</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a272"></a>    <span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a273"></a>&nbsp;</li>
<li><a name="a274"></a><span class="src-str">    /**</span></li>
<li><a name="a275"></a><span class="src-str">     *  @todo Document this method</span></li>
<li><a name="a276"></a><span class="src-str">     *  @uses add_default_name_and_id()</span></li>
<li><a name="a277"></a><span class="src-str">     */</span></li>
<li><a name="a278"></a><span class="src-str">    <span class="src-key">function</span> <span class="src-id">to_boolean_select_tag</span><span class="src-sym">(</span><span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a279"></a><span class="src-str">        <span class="src-var">$options</span> = <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methodadd_default_name_and_id">add_default_name_and_id</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a280"></a>        <span class="src-var">$tag_text </span>= <span class="src-str">&quot;&lt;select &quot;</span><span class="src-sym">;</span></li>
<li><a name="a281"></a>        <span class="src-var">$tag_text </span>.= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodtag_options">tag_options</a><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a282"></a>        <span class="src-var">$tag_text </span>.= <span class="src-str">&quot;&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a283"></a>        <span class="src-var">$tag_text </span>.= <span class="src-str">&quot;&lt;option value=\&quot;0\&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a284"></a>        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">) </span>== <span class="src-id">false</span><span class="src-sym">) <span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a285"></a><span class="src-str">            <span class="src-var">$tag_text</span> .= <span class="src-str">&quot; selected&quot;</span><span class="src-sym">;</span></span></li>
<li><a name="a286"></a><span class="src-str">        <span class="src-sym">}</span></span></li>
<li><a name="a287"></a><span class="src-str">        <span class="src-var">$tag_text</span> .= <span class="src-str">&quot;&gt;False&lt;/option&gt;\n&quot;</span><span class="src-sym">;</span></span></li>
<li><a name="a288"></a><span class="src-str">        <span class="src-var">$tag_text</span> .= <span class="src-str">&quot;&lt;option value=\&quot;1\&quot;&quot;</span><span class="src-sym">;</span></span></li>
<li><a name="a289"></a><span class="src-str">        <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodvalue">value</a><span class="src-sym">(</span><span class="src-sym">)) <span class="src-str"></span><span class="src-sym">{</span></span></li>
<li><a name="a290"></a><span class="src-str">            <span class="src-var">$tag_text</span> .= <span class="src-str">&quot; selected&quot;</span><span class="src-sym">;</span></span></li>
<li><a name="a291"></a><span class="src-str">        <span class="src-sym">}</span></span></li>
<li><a name="a292"></a><span class="src-str">        <span class="src-var">$tag_text</span> .= <span class="src-str">&quot;&gt;True&lt;/option&gt;\n&quot;</span><span class="src-sym">;</span></span></li>
<li><a name="a293"></a><span class="src-str">        <span class="src-var">$tag_text</span> .= <span class="src-str">&quot;&lt;/select&gt;\n&quot;</span><span class="src-sym">;</span></span></li>
<li><a name="a294"></a><span class="src-str">        <span class="src-key">return</span> <span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/FormHelper.html#methoderror_wrapping">error_wrapping</a><span class="src-sym">(</span><span class="src-var">$tag_text</span><span class="src-sym">,</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#methodobject">object</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">errors</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../PHPonTrax/Helpers.html#var$attribute_name">attribute_name</a><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;;</span></li>
<li><a name="a295"></a>    <span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a296"></a><span class="src-str">    </span></li>
<li><a name="a297"></a><span class="src-str">    /**</span></li>
<li><a name="a298"></a><span class="src-str">     *  If this tag has an error, wrap it with a visual indicator</span></li>
<li><a name="a299"></a><span class="src-str">     *</span></li>
<li><a name="a300"></a><span class="src-str">     *  @param string HTML to be wrapped</span></li>
<li><a name="a301"></a><span class="src-str">     *  @param boolean  true=&gt;error, false=&gt;no error</span></li>
<li><a name="a302"></a><span class="src-str">     *  @return string</span></li>
<li><a name="a303"></a><span class="src-str">     */</span></li>
<li><a name="a304"></a><span class="src-str">    <span class="src-key">function</span> <span class="src-id">error_wrapping</span><span class="src-sym">(</span><span class="src-var">$html_tag</span><span class="src-sym">,</span> <span class="src-var">$has_error</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a305"></a><span class="src-str">        <span class="src-key">return</span> <span class="src-sym">(</span><span class="src-var">$has_error</span></span></li>
<li><a name="a306"></a><span class="src-str">                ? <span class="src-str">'&lt;span class=&quot;fieldWithErrors&quot;&gt;'</span> . <span class="src-var">$html_tag</span> . <span class="src-str">'&lt;/span&gt;'</span></span></li>
<li><a name="a307"></a><span class="src-str">                : <span class="src-var">$html_tag</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a308"></a><span class="src-str">    <span class="src-sym">}</span>    </span></li>
<li><a name="a309"></a>&nbsp;</li>
<li><a name="a310"></a><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a311"></a>&nbsp;</li>
<li><a name="a312"></a>&nbsp;</li>
<li><a name="a313"></a><span class="src-str">/**</span></li>
<li><a name="a314"></a><span class="src-str"> *  Generate HTML/XML for &lt;input type=&quot;text&quot; /&gt; in a view file</span></li>
<li><a name="a315"></a><span class="src-str"> *</span></li>
<li><a name="a316"></a><span class="src-str"> *  Example: In the view file, code</span></li>
<li><a name="a317"></a><span class="src-str"> *           &lt;code&gt;&lt;?= text_field(&quot;Person&quot;, &quot;fname&quot;); ?&gt;&lt;/code&gt;</span></li>
<li><a name="a318"></a><span class="src-str"> *  Result: &lt;input id=&quot;Person_fname&quot; name=&quot;Person[fname]&quot; size=&quot;30&quot; type=&quot;text&quot; value=&quot;$Person-&gt;fname&quot; /&gt;</span></li>
<li><a name="a319"></a><span class="src-str"> *  @param string  Class name of the object being processed</span></li>
<li><a name="a320"></a><span class="src-str"> *  @param string  Name of attribute in the object being processed</span></li>
<li><a name="a321"></a><span class="src-str"> *  @param string[]  Attributes to apply to the generated input tag as:&lt;br&gt;</span></li>
<li><a name="a322"></a><span class="src-str"> *    &lt;samp&gt;array('attr1' =&gt; 'value1'[, 'attr2' =&gt; 'value2']...)&lt;/samp&gt;</span></li>
<li><a name="a323"></a><span class="src-str"> *  @uses FormHelper::to_input_field_tag()</span></li>
<li><a name="a324"></a><span class="src-str"> */</span></li>
<li><a name="a325"></a><span class="src-str"><span class="src-key">function</span> <span class="src-id">text_field</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a326"></a><span class="src-str">    <span class="src-var">$form</span> = <span class="src-key">new</span> <span class="src-id">FormHelper</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a327"></a><span class="src-str">    <span class="src-key">return</span> <span class="src-var">$form</span></span><span class="src-sym">-&gt;</span><span class="src-id">to_input_field_tag</span><span class="src-sym">(</span><span class="src-str">&quot;text&quot;</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a328"></a><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a329"></a>&nbsp;</li>
<li><a name="a330"></a><span class="src-str">/**</span></li>
<li><a name="a331"></a><span class="src-str"> *  Works just like text_field, but returns a input tag of the &quot;password&quot; type instead.</span></li>
<li><a name="a332"></a><span class="src-str"> * Example: password_field(&quot;user&quot;, &quot;password&quot;);</span></li>
<li><a name="a333"></a><span class="src-str"> *  Result: &lt;input type=&quot;password&quot; id=&quot;user_password&quot; name=&quot;user[password]&quot; value=&quot;$user-&gt;password&quot; /&gt;</span></li>
<li><a name="a334"></a><span class="src-str"> *  @uses FormHelper::to_input_field_tag()</span></li>
<li><a name="a335"></a><span class="src-str"> */</span></li>
<li><a name="a336"></a><span class="src-str"><span class="src-key">function</span> <span class="src-id">password_field</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a337"></a><span class="src-str">    <span class="src-var">$form</span> = <span class="src-key">new</span> <span class="src-id">FormHelper</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a338"></a><span class="src-str">    <span class="src-key">return</span> <span class="src-var">$form</span></span><span class="src-sym">-&gt;</span><span class="src-id">to_input_field_tag</span><span class="src-sym">(</span><span class="src-str">&quot;password&quot;</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a339"></a><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a340"></a>&nbsp;</li>
<li><a name="a341"></a><span class="src-str">/**</span></li>
<li><a name="a342"></a><span class="src-str"> *  Works just like text_field, but returns a input tag of the &quot;hidden&quot; type instead.</span></li>
<li><a name="a343"></a><span class="src-str"> *  Example: hidden_field(&quot;post&quot;, &quot;title&quot;);</span></li>
<li><a name="a344"></a><span class="src-str"> *  Result: &lt;input type=&quot;hidden&quot; id=&quot;post_title&quot; name=&quot;post[title]&quot; value=&quot;$post-&gt;title&quot; /&gt;</span></li>
<li><a name="a345"></a><span class="src-str"> *  @uses FormHelper::to_input_field_tag()</span></li>
<li><a name="a346"></a><span class="src-str"> */</span></li>
<li><a name="a347"></a><span class="src-str"><span class="src-key">function</span> <span class="src-id">hidden_field</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a348"></a><span class="src-str">    <span class="src-var">$form</span> = <span class="src-key">new</span> <span class="src-id">FormHelper</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a349"></a><span class="src-str">    <span class="src-key">return</span> <span class="src-var">$form</span></span><span class="src-sym">-&gt;</span><span class="src-id">to_input_field_tag</span><span class="src-sym">(</span><span class="src-str">&quot;hidden&quot;</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a350"></a><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a351"></a>&nbsp;</li>
<li><a name="a352"></a><span class="src-str">/**</span></li>
<li><a name="a353"></a><span class="src-str"> * Works just like text_field, but returns a input tag of the &quot;file&quot; type instead, which won't have any default value.</span></li>
<li><a name="a354"></a><span class="src-str"> *  @uses FormHelper::to_input_field_tag()</span></li>
<li><a name="a355"></a><span class="src-str"> */</span></li>
<li><a name="a356"></a><span class="src-str"><span class="src-key">function</span> <span class="src-id">file_field</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a357"></a><span class="src-str">    <span class="src-var">$form</span> = <span class="src-key">new</span> <span class="src-id">FormHelper</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a358"></a><span class="src-str">    <span class="src-key">return</span> <span class="src-var">$form</span></span><span class="src-sym">-&gt;</span><span class="src-id">to_input_field_tag</span><span class="src-sym">(</span><span class="src-str">&quot;file&quot;</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a359"></a><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a360"></a>&nbsp;</li>
<li><a name="a361"></a><span class="src-str">/**</span></li>
<li><a name="a362"></a><span class="src-str"> *  Example: text_area(&quot;post&quot;, &quot;body&quot;, array(&quot;cols&quot; =&gt; 20, &quot;rows&quot; =&gt; 40));</span></li>
<li><a name="a363"></a><span class="src-str"> *  Result: &lt;textarea cols=&quot;20&quot; rows=&quot;40&quot; id=&quot;post_body&quot; name=&quot;post[body]&quot;&gt;$post-&gt;body&lt;/textarea&gt;</span></li>
<li><a name="a364"></a><span class="src-str"> *  @uses FormHelper::to_text_area_tag()</span></li>
<li><a name="a365"></a><span class="src-str"> */</span></li>
<li><a name="a366"></a><span class="src-str"><span class="src-key">function</span> <span class="src-id">text_area</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a367"></a><span class="src-str">    <span class="src-var">$form</span> = <span class="src-key">new</span> <span class="src-id">FormHelper</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a368"></a><span class="src-str">    <span class="src-key">return</span> <span class="src-var">$form</span></span><span class="src-sym">-&gt;</span><span class="src-id">to_text_area_tag</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a369"></a><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a370"></a>&nbsp;</li>
<li><a name="a371"></a><span class="src-str">/**</span></li>
<li><a name="a372"></a><span class="src-str"> * Returns a checkbox tag tailored for accessing a specified attribute (identified by $field) on an object</span></li>
<li><a name="a373"></a><span class="src-str"> * assigned to the template (identified by $object). It's intended that $field returns an integer and if that</span></li>
<li><a name="a374"></a><span class="src-str"> * integer is above zero, then the checkbox is checked. Additional $options on the input tag can be passed as an</span></li>
<li><a name="a375"></a><span class="src-str"> * array with $options. The $checked_value defaults to 1 while the default $unchecked_value</span></li>
<li><a name="a376"></a><span class="src-str"> * is set to 0 which is convenient for boolean values. Usually unchecked checkboxes don't post anything.</span></li>
<li><a name="a377"></a><span class="src-str"> * We work around this problem by adding a hidden value with the same name as the checkbox.</span></li>
<li><a name="a378"></a><span class="src-str">#</span></li>
<li><a name="a379"></a><span class="src-str"> * Example: Imagine that $post-&gt;validated is 1:</span></li>
<li><a name="a380"></a><span class="src-str"> *   check_box(&quot;post&quot;, &quot;validated&quot;);</span></li>
<li><a name="a381"></a><span class="src-str"> * Result:</span></li>
<li><a name="a382"></a><span class="src-str"> *   &lt;input type=&quot;checkbox&quot; id=&quot;post_validate&quot; name=&quot;post[validated] value=&quot;1&quot; checked=&quot;checked&quot; /&gt;</span></li>
<li><a name="a383"></a><span class="src-str"> *   &lt;input name=&quot;post[validated]&quot; type=&quot;hidden&quot; value=&quot;0&quot; /&gt;</span></li>
<li><a name="a384"></a><span class="src-str">#</span></li>
<li><a name="a385"></a><span class="src-str"> * Example: Imagine that $puppy-&gt;gooddog is no:</span></li>
<li><a name="a386"></a><span class="src-str"> *   check_box(&quot;puppy&quot;, &quot;gooddog&quot;, array(), &quot;yes&quot;, &quot;no&quot;);</span></li>
<li><a name="a387"></a><span class="src-str"> * Result:</span></li>
<li><a name="a388"></a><span class="src-str"> *     &lt;input type=&quot;checkbox&quot; id=&quot;puppy_gooddog&quot; name=&quot;puppy[gooddog] value=&quot;yes&quot; /&gt;</span></li>
<li><a name="a389"></a><span class="src-str"> *     &lt;input name=&quot;puppy[gooddog]&quot; type=&quot;hidden&quot; value=&quot;no&quot; /&gt;</span></li>
<li><a name="a390"></a><span class="src-str">   *  @uses FormHelper::to_check_box_tag()</span></li>
<li><a name="a391"></a><span class="src-str"> */</span></li>
<li><a name="a392"></a><span class="src-str"><span class="src-key">function</span> <span class="src-id">check_box</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$checked_value</span> = <span class="src-str">&quot;1&quot;</span><span class="src-sym">,</span> <span class="src-var">$unchecked_value</span> = <span class="src-str">&quot;0&quot;</span><span class="src-sym">)</span> <span class="src-sym">{</span></span></li>
<li><a name="a393"></a><span class="src-str">    <span class="src-var">$form</span> = <span class="src-key">new</span> <span class="src-id">FormHelper</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a394"></a><span class="src-str">    <span class="src-key">return</span> <span class="src-var">$form</span></span><span class="src-sym">-&gt;</span><span class="src-id">to_check_box_tag</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">, </span><span class="src-var">$checked_value</span><span class="src-sym">, </span><span class="src-var">$unchecked_value</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a395"></a><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a396"></a>&nbsp;</li>
<li><a name="a397"></a><span class="src-str">/**</span></li>
<li><a name="a398"></a><span class="src-str"> * Returns a radio button tag for accessing a specified attribute (identified by $field) on an object</span></li>
<li><a name="a399"></a><span class="src-str"> * assigned to the template (identified by $object). If the current value of $field is $tag_value the</span></li>
<li><a name="a400"></a><span class="src-str"> * radio button will be checked. Additional $options on the input tag can be passed as a</span></li>
<li><a name="a401"></a><span class="src-str"> * hash with $options.</span></li>
<li><a name="a402"></a><span class="src-str"> * Example: Imagine that $post-&gt;category is &quot;trax&quot;:</span></li>
<li><a name="a403"></a><span class="src-str"> *   radio_button(&quot;post&quot;, &quot;category&quot;, &quot;trax&quot;);</span></li>
<li><a name="a404"></a><span class="src-str"> *   radio_button(&quot;post&quot;, &quot;category&quot;, &quot;java&quot;);</span></li>
<li><a name="a405"></a><span class="src-str"> * Result:</span></li>
<li><a name="a406"></a><span class="src-str"> *     &lt;input type=&quot;radio&quot; id=&quot;post_category&quot; name=&quot;post[category] value=&quot;trax&quot; checked=&quot;checked&quot; /&gt;</span></li>
<li><a name="a407"></a><span class="src-str"> *     &lt;input type=&quot;radio&quot; id=&quot;post_category&quot; name=&quot;post[category] value=&quot;java&quot; /&gt;</span></li>
<li><a name="a408"></a><span class="src-str"> *  @uses FormHelper::to_radio_button_tag()</span></li>
<li><a name="a409"></a><span class="src-str"> */</span></li>
<li><a name="a410"></a><span class="src-str"><span class="src-key">function</span> <span class="src-id">radio_button</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">,</span> <span class="src-var">$tag_value</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a411"></a><span class="src-str">    <span class="src-var">$form</span> = <span class="src-key">new</span> <span class="src-id">FormHelper</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a412"></a><span class="src-str">    <span class="src-key">return</span> <span class="src-var">$form</span></span><span class="src-sym">-&gt;</span><span class="src-id">to_radio_button_tag</span><span class="src-sym">(</span><span class="src-var">$tag_value</span><span class="src-sym">, </span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a413"></a><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a414"></a>&nbsp;</li>
<li><a name="a415"></a><span class="src-str">/**</span></li>
<li><a name="a416"></a><span class="src-str"> *  Make a new FormHelper object and call its to_boolean_select_tag method</span></li>
<li><a name="a417"></a><span class="src-str"> *  @uses FormHelper::to_boolean_select_tag()</span></li>
<li><a name="a418"></a><span class="src-str"> */</span></li>
<li><a name="a419"></a><span class="src-str"><span class="src-key">function</span> <span class="src-id">boolean_select</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">,</span> <span class="src-var">$options</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span> <span class="src-sym">{</span></span></li>
<li><a name="a420"></a><span class="src-str">    <span class="src-var">$form</span> = <span class="src-key">new</span> <span class="src-id">FormHelper</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,</span> <span class="src-var">$field</span><span class="src-sym">)</span><span class="src-sym">;</span></span></li>
<li><a name="a421"></a><span class="src-str">    <span class="src-key">return</span> <span class="src-var">$form</span></span><span class="src-sym">-&gt;</span><span class="src-id">to_boolean_select_tag</span><span class="src-sym">(</span><span class="src-var">$options</span><span class="src-sym">)</span><span class="src-sym">;        </span></li>
<li><a name="a422"></a><span class="src-str"><span class="src-sym">}</span></span></li>
<li><a name="a423"></a>&nbsp;</li>
<li><a name="a424"></a><span class="src-str"><span class="src-comm">// -- set Emacs parameters --</span></span></li>
<li><a name="a425"></a><span class="src-str"><span class="src-comm">// Local variables:</span></span></li>
<li><a name="a426"></a><span class="src-str"><span class="src-comm">// tab-width: 4</span></span></li>
<li><a name="a427"></a><span class="src-str"><span class="src-comm">// c-basic-offset: 4</span></span></li>
<li><a name="a428"></a><span class="src-str"><span class="src-comm">// c-hanging-comment-ender-p: nil</span></span></li>
<li><a name="a429"></a><span class="src-str"><span class="src-comm">// indent-tabs-mode: nil</span></span></li>
<li><a name="a430"></a><span class="src-str"><span class="src-comm">// End:</span></span></li>
</ol></pre></div>
</div>
        <div class="credit">
		    <hr />
		    Documentation generated on Thu, 04 May 2006 19:47:41 -0600 by <a href="http://www.phpdoc.org">phpDocumentor 1.3.0RC4</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>
Return current item: PHP on Trax