depage-forms v1.4.1
html forms made easy
Loading...
Searching...
No Matches
Datetimelocal.php
Go to the documentation of this file.
1<?php
2
10
11namespace Depage\HtmlForm\Elements;
12
18class Datetimelocal extends Text
19{
27 public function __toString(): string
28 {
29 $wrapperAttributes = $this->htmlWrapperAttributes();
30 $label = $this->htmlLabel();
31 $marker = $this->htmlMarker();
32 $value = $this->htmlValue();
33 $inputAttributes = $this->htmlInputAttributes();
36
37 return "<p {$wrapperAttributes}>" .
38 "<label>" .
39 "<span class=\"depage-label\">{$label}{$marker}</span>" .
40 "<input name=\"{$this->name}\" type=\"datetime-local\"{$inputAttributes} value=\"{$value}\">" .
41 "</label>" .
44 "</p>\n";
45 }
46}
47
48/* vim:set ft=php sw=4 sts=4 fdm=marker et : */
$value
Input elements's value.
Definition Input.php:124
$label
Input element - HTML label.
Definition Input.php:37
$errorMessage
Message that gets displayed in case of invalid input.
Definition Input.php:218
htmlHelpMessage()
Returns HTML-rendered helpMessage.
Definition Input.php:685
htmlWrapperAttributes()
Returns string of HTML attributes for element wrapper paragraph.
Definition Input.php:636
htmlMarker()
Returns elements' required-indicator.
Definition Input.php:566
$helpMessage
Extra help message.
Definition Input.php:230
htmlValue()
Returns HTML-rendered element value.
Definition Input.php:656
$marker
Input element - HTML marker text that marks required fields.
Definition Input.php:92
htmlErrorMessage()
Returns HTML-rendered error message.
Definition Input.php:666
HTML datetime-local input type.
__toString()
Renders element to HTML.
HTML text input type.
Definition Text.php:40
htmlInputAttributes()
renders text element specific HTML attributes
Definition Text.php:160