我使用 extension_builder 创建了一个新扩展并添加了一个选择字段:
'selectlist' => array(
'exclude' => 1,
'label' => 'LLL:EXT:my_test/Resources/Private/Language/locallang_db.xlf:tx_mytest_domain_model_test.selectlist',
'config' => array(
'type' => 'select',
'renderType' => 'selectSingle',
'items' => array(
array('LLL:EXT:my_test/Resources/Private/Language/locallang.xlf:tx_mytest_domain_model_test.selectlist.item1', 0),
array('LLL:EXT:my_test/Resources/Private/Language/locallang.xlf:tx_mytest_domain_model_test.selectlist.item2', 1),
),
'size' => 1,
'maxitems' => 1,
'eval' => ''
),
),
在模板中,我通过以下方式访问此字段:
<td><f:link.action action="show" arguments="{test : test}"> {test.selectlist}</f:link.action></td>
问题是这test.selectlist
只是选择项的关键。但我需要的是值(在我的例子中是来自 locallang.xlf 的翻译值)。
我还没有找到任何关于如何访问模板中的值的文档。
可能吗?我该怎么做?