TYPO3 CMS
TYPO3_6-2
Main Page
Related Pages
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
+
Files
File List
+
File Members
+
All
$
(
_
a
c
d
e
f
h
i
l
o
p
r
s
t
u
x
+
Functions
_
a
c
d
e
f
i
l
o
p
r
s
u
x
+
Variables
$
(
_
a
d
e
h
i
p
r
s
t
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
IdAttribute.php
Go to the documentation of this file.
1
<?php
2
namespace
TYPO3\CMS\Form\Domain\Model\Attribute
;
3
22
class
IdAttribute
extends
\TYPO3\CMS\Form\Domain\Model\Attribute\AbstractAttribute
{
23
34
public
function
getValue
() {
35
$value
= (string) $this->value;
36
if
($this->elementClassName ===
'TYPO3\\CMS\\Form\\Domain\\Model\\Form'
) {
37
if
(empty(
$value
)) {
38
$value
=
'form-'
.
$GLOBALS
[
'TSFE'
]->id;
39
}
40
} elseif (empty(
$value
)) {
41
$value
=
$this->elementId
;
42
if
(is_integer(
$value
)) {
43
$value
=
'field-'
.
$value
;
44
}
45
}
46
// Change spaces into hyphens
47
$attribute = preg_replace(
'/\\s/'
,
'-'
,
$value
);
48
// Change first non-letter to field-
49
if
(preg_match(
'/^([^a-zA-Z]{1})/'
, $attribute)) {
50
$attribute =
'field-'
. $attribute;
51
}
52
// Remove non-word characters
53
$attribute = preg_replace(
'/([^a-zA-Z0-9_:\\-\\.]*)/'
,
''
, $attribute);
54
return
$attribute;
55
}
56
57
}
TYPO3\CMS\Form\Domain\Model\Attribute\AbstractAttribute\$value
$value
Definition:
AbstractAttribute.php:29
TYPO3\CMS\Form\Domain\Model\Attribute\AbstractAttribute\$elementId
$elementId
Definition:
AbstractAttribute.php:36
TYPO3\CMS\Form\Domain\Model\Attribute\AbstractAttribute
Definition:
AbstractAttribute.php:22
TYPO3\CMS\Form\Domain\Model\Attribute
Definition:
AbstractAttribute.php:2
TYPO3\CMS\Form\Domain\Model\Attribute\IdAttribute\getValue
getValue()
Definition:
IdAttribute.php:34
TYPO3\CMS\Form\Domain\Model\Attribute\IdAttribute
Definition:
IdAttribute.php:22
$GLOBALS
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
Definition:
ext_localconf.php:5
typo3
sysext
form
Classes
Domain
Model
Attribute
IdAttribute.php
Generated on Wed Aug 7 2019 09:52:27 for TYPO3 CMS by
1.8.13