Attention
TYPO3 v12 has reached end-of-life as of April 30th 2026 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v12 here: TYPO3 ELTS.
strPad
This property returns the input value padded to a certain length. The
padding is added on the left side, the right side or on both sides.
str uses the PHP function str_pad()
for the operation.
Properties
length
length
padWith
padWith
-
The character(s) to pad with. The value of
padmay be truncated, if the required number of padding characters cannot be evenly divided by the length of the value ofWith pad. Note that leading and trailing spaces ofWith padare stripped! If you want to pad with spaces, omit this option.With
type
type
-
- Type
- (list of keywords) / stdWrap
- Default
- right
The side(s) of the input value, on which the padding should be added. Possible keywords are "left", "right" or "both".
Examples
10 = TEXT
# The input value is 34 signs long.
10.value = TYPO3 - inspiring people to share.
10.value.strPad {
length = 37
padWith = =
type = both
}
This results in "=TYPO3 - inspiring people to share.==".