src/HtmlGenerator.php
/**
     * Generates a textaread form element
     * 
     * @param string name          - name attribute of the textarea
     * @param currentValue         - text that should appear in the texatrea as
     *                               the current value.
     * @param string placeholder   - any text that should show in the textarea 
     *                               if there is no value.
     * @param string class         - class to specify for the textarea (style)
     * @param int rows             - number of rows the textarea should have
     * @param int cols             - number of columns (width) of the textarea
     * @param string id (optional) - if set the id will be set to this.
     * @param bool disabled
     * 
     * @return string - the generated html for the textarea. 
     */
Generates a textaread form element

@param string name          - name attribute of the textarea
@param currentValue         - text that should appear in the texatrea as
the current value.
@param string placeholder   - any text that should show in the textarea
if there is no value.
@param string class         - class to specify for the textarea (style)
@param int rows             - number of rows the textarea should have
@param int cols             - number of columns (width) of the textarea
@param string id (optional) - if set the id will be set to this.
@param bool disabled

@return string - the generated html for the textarea.
Generates a textaread form element @param string name - name attribute of the textarea @param currentValue - text that should appear in the texatrea as the current value . @param string placeholder - any text that should show in the textarea if there is no value . @param string class - class to specify for the textarea ( style ) @param int rows - number of rows the textarea should have @param int cols - number of columns ( width ) of the textarea @param string id ( optional ) - if set the id will be set to this . @param bool disabled @return string - the generated html for the textarea .
public static function generateTextArea($name, 
                                            $currentValue = "", 
                                            $placeholder  = "", 
                                            $class        = "",
                                            $rows         = "",
                                            $cols         = "",
                                            $id           = "",
                                            $disabled     = false)
    {
        $idAttribute = '';
        $rowAttribute = '';
        $colsAttribute = '';
        $disabledAttribute = '';
        if ($rows != "")
        {
            $rowAttribute = ' rows="' . $rows . '" ';
        }
        if ($cols != "")
        {
            $colsAttribute = ' cols="' . $cols . '" ';
        }
        if ($id != "")
        {
            $idAttribute = ' id="' . $id . '" ';
        }
        if ($disabled)
        {
            $disabledAttribute = ' disabled ';
        }
        $html = '<textarea ' .
                    'name="' . $name . '" ' .
                    'class="' . $class . '" ' .
                    'placeholder="' . $placeholder . '" ' .
                    $idAttribute .
                    $rowAttribute .
                    $colsAttribute .
                    $disabledAttribute .
                '>'  . 
                    $currentValue . 
                '</textarea>';
        return $html;
    }
public static function generateTextArea ( $ name , $ currentValue = " " , $ placeholder = " " , $ class = " " , $ rows = " " , $ cols = " " , $ id = " " , $ disabled = false ) { $ idAttribute = '' ; $ rowAttribute = '' ; $ colsAttribute = '' ; $ disabledAttribute = '' ; if ( $ rows != " " ) { $ rowAttribute = ' rows="' . $ rows . '" ' ; } if ( $ cols != " " ) { $ colsAttribute = ' cols="' . $ cols . '" ' ; } if ( $ id != " " ) { $ idAttribute = ' id="' . $ id . '" ' ; } if ( $ disabled ) { $ disabledAttribute = ' disabled ' ; } $ html = '<textarea ' . 'name="' . $ name . '" ' . 'class="' . $ class . '" ' . 'placeholder="' . $ placeholder . '" ' . $ idAttribute . $ rowAttribute . $ colsAttribute . $ disabledAttribute . '>' . $ currentValue . '</textarea>' ; return $ html ; }
Generates a textaread form element
Generates a textaread form element