[英]Typo3 RealURL: UID with leading zeros
Assuming the following Typo3 RealURL setup: 假设以下Typo3 RealURL设置:
'news' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
),
array(
'GETvar' => 'tx_news_pi1[controller]',
),
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => 'CONCAT(title, "-", uid)',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-',
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
),
),
),
It's about this line: 'alias_field' => 'CONCAT(title, "-", uid)',
关于这一行:
'alias_field' => 'CONCAT(title, "-", uid)',
I need to add leading zeros to uid
, so it has at least three digits. 我需要在
uid
上添加前导零,因此它至少具有三位数。
Outside of an array, it would be: $uid = sprintf('%03d', $uid);
在数组之外,它将是:
$uid = sprintf('%03d', $uid);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.