我在 RenderType = selectMultipleSideBySide 中使用 T3 后端的 TCA 类型选择
这里是 TCA 代码:
'features' => array(
'label' => 'Zusatz',
'config' => array(
'type' => 'select',
'renderType' => 'selectMultipleSideBySide',
'size' => 10,
'minitems' => 0,
'maxitems' => 999,
'items' => array(
array(
'Parkplätze',
'parking'
),
array(
'Freies Wlan',
'wlan'
),
)
)
),
它在后端工作正常!
但是,我现在怎样才能正确读取数据呢?我现在不适合域/模型的正确方法。
/**
* Features
*
* @var string
*/
protected $features = '';
/**
* Returns the features
*
* @return string $features
*/
public function getFeatures() {
return $this->features;
}
/**
* Sets the features
*
* @param string $features
* @return void
*/
public function setFeatures($features) {
$this->features = $features;
}
调试代码推出:features => 'parking,wlan' (12 chars)
对于每个不起作用:
<f:for each="{newsItem.features}" as="featuresItem">
{featuresItem}<br />
</f:for>
感谢帮助!