depage-forms v1.4.1
html forms made easy
Loading...
Searching...
No Matches
Hidden.php
Go to the documentation of this file.
1<?php
2
10
11namespace Depage\HtmlForm\Elements;
12
37class Hidden extends Text
38{
44 public function __toString(): string
45 {
46 $formName = $this->htmlFormName();
47 $classes = $this->htmlClasses();
48 $value = $this->htmlValue();
49 $type = strtolower($this->type);
50
51 return "<input name=\"{$this->name}\" id=\"{$formName}-{$this->name}\" type=\"{$type}\" class=\"{$classes}\" value=\"{$value}\">\n";
52 }
53}
54
55/* vim:set ft=php sw=4 sts=4 fdm=marker et : */
$value
Input elements's value.
Definition Input.php:124
$formName
Name of the parent HTML form.
Definition Input.php:119
$classes
HTML classes attribute for rendering the input element.
Definition Input.php:157
$type
Input element type - HTML input type attribute.
Definition Input.php:26
htmlValue()
Returns HTML-rendered element value.
Definition Input.php:656
htmlClasses()
Returns string of the elements' HTML-classes, separated by spaces.
Definition Input.php:532
HTML hidden input type.
Definition Hidden.php:38
__toString()
Renders element to HTML.
Definition Hidden.php:44
HTML text input type.
Definition Text.php:40