Exemplo n.º 1
0
 /**
  * Returns <input />.
  * 
  * @param \string $name The name of the element.
  * @param \string $type The type of the input.
  * @param \string $value The value of the input.
  * @param \array $htmlAttributes The additional attributes. Associative array - key = value.
  * 
  * @return \string
  */
 private static function Input($type, $name, $value, $htmlAttributes = NULL)
 {
     if (!isset($htmlAttributes) || count($htmlAttributes) <= 0) {
         $htmlAttributes = array();
     }
     $htmlAttributes['type'] = $type;
     $result = '<input ';
     $result .= Html::BuildAttributes($htmlAttributes) . ' ';
     $result .= 'name="' . $name . '" id="' . $name . '" ';
     if (\Nemiro\Server::IsPostBack() && isset($_POST[$name])) {
         $result .= 'value="' . $_POST[$name] . '" ';
     } else {
         if ($value != NULL && strlen($value) > 0) {
             $result .= 'value="' . $value . '" ';
         }
     }
     $result .= '/>';
     return $result;
 }