15 public function transform($attr, $config, $context) {
16 if (!isset($attr[
'type']))
$t =
'text';
17 else $t = strtolower($attr[
'type']);
18 if (isset($attr[
'checked']) &&
$t !==
'radio' &&
$t !==
'checkbox') {
19 unset($attr[
'checked']);
21 if (isset($attr[
'maxlength']) &&
$t !==
'text' &&
$t !==
'password') {
22 unset($attr[
'maxlength']);
24 if (isset($attr[
'size']) &&
$t !==
'text' &&
$t !==
'password') {
25 $result = $this->pixels->validate($attr[
'size'], $config, $context);
26 if (
$result ===
false) unset($attr[
'size']);
29 if (isset($attr[
'src']) &&
$t !==
'image') {
32 if (!isset($attr[
'value']) && (
$t ===
'radio' ||
$t ===
'checkbox')) {
Validates an integer representation of pixels according to the HTML spec.