我用于 TYPO3 TCA 后端国家选择器、类型选择和 EXT:static_info_tables // static_info_tables_de
它在后端完美运行。我这里有一个国家——选择:
'land' => array(
'exclude' => 1,
'label' => 'Land',
'displayCond' => 'EXT:static_info_tables_de:LOADED:true',
'config' => array(
'type' => 'select',
'renderType' => 'selectSingle',
'items' => array(
array('', 0)
),
'foreign_table' => 'static_countries',
'allowNonIdValues' => TRUE,
'foreign_table_where' => 'ORDER BY static_countries.cn_short_de',
'itemsProcFunc' => 'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\FormDataProvider\\TcaSelectItemsProcessor->translateCountriesSelector',
//'itemsProcFunc_config' => array(
// 'indexField' => 'cn_short_de',
//),
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
'default' => '54', // Default Germany value="54"
'eval' => 'required'
)
),
FE Debug 输出为 =land => '54' (2 chars)
但是,我不知道如何更改 Country-Name 中的 ID?
这是模型 - 代码:
/**
* Land
*
* @var string
*
*/
protected $land = '';
/**
* Returns the land
*
* @return string $land
*/
public function getLand() {
return $this->land;
}
/**
* Sets the land
*
* @param string $land
* @return void
*/
public function setLand($land) {
$this->land = $land;
}
我为 FE Select-Form 找到了这个示例,但我需要正确的“Country”-Name 而不是 FORM-Selector。 https://docs.typo3.org/typo3cms/extensions/static_info_tables/ExtbaseDomainModel/UsingTheModel/AddingACountrySelectFieldToAForm/Index.html
我想,我不需要“字符串”..我需要这个:
@param \SJBR\StaticInfoTables\Domain\Repository\CountryRepository $land
感谢帮助!塞巴斯蒂安