src/HtmlGenerator.php
/**
    * Generates a html input field
    *
    * @param string name - name of the input field so we can retrieve the value 
    *                      with GET or POST
    * @param string type - type of input field. e.g. text, password, checkbox
     *                     should not be 'submit' or 'button', use other funcs 
    *                      for those
    * @param string currentValue - (optional) the current value of the input field.
    * @param string placeholder  - (optional) specify the placeholder text
    * 
    * @return string - the generated html.
    */
Generates a html input field
@param string name - name of the input field so we can retrieve the value
with GET or POST
@param string type - type of input field.

@return string - the generated html.
Generates a html input field @param string name - name of the input field so we can retrieve the value with GET or POST @param string type - type of input field . @return string - the generated html .
public static function generateInputField($name, 
                                              $type, 
                                              $currentValue="", 
                                              $placeholder="")
    {
        $type = strtolower($type);
        if ($type === 'button')
        {
            $msg = 'Developer error: please use the generateButton function ' . 
                   'instead to create buttons.';
            throw new \Exception($msg);
        }
        if ($type == 'submit')
        {
            $msg = 'Developer error: please use the generateSubmitButton ' . 
                   'function instead to create submit buttons.';
            throw new \Exception($msg);
        }
        $html = '<input ' .
                    'type="' . $type . '" ' .
                    'name="' . $name .'" ' . 
                    'placeholder="' . $placeholder . '" ' . 
                    'value="' . $currentValue . '" >';
        return $html;
    }
public static function generateInputField ( $ name , $ type , $ currentValue = " " , $ placeholder = " " ) { $ type = strtolower ( $ type ) ; if ( $ type === 'button' ) { $ msg = 'Developer error: please use the generateButton function ' . 'instead to create buttons.' ; throw new \ Exception ( $ msg ) ; } if ( $ type == 'submit' ) { $ msg = 'Developer error: please use the generateSubmitButton ' . 'function instead to create submit buttons.' ; throw new \ Exception ( $ msg ) ; } $ html = '<input ' . 'type="' . $ type . '" ' . 'name="' . $ name . '" ' . 'placeholder="' . $ placeholder . '" ' . 'value="' . $ currentValue . '" >' ; return $ html ; }
Generates a html input field
 @param string name - name of the input field so we can retrieve the value
                      with GET or POST
 @param string type - type of input field.
Generates a html input field @param string name - name of the input field so we can retrieve the value with GET or POST @param string type - type of input field .