Typo3 类型3 TCA类型选择流体中的静态信息表格?

Typo3 类型3 TCA类型选择流体中的静态信息表格?,typo3,fluid,typo3-7.6.x,Typo3,Fluid,Typo3 7.6.x,我用于TYPO3 TCA后端国家/地区选择器、类型选择和EXT:static\u info\u tables//static\u info\u tables\u de 它在后端工作非常完美。我在这里选择了一个国家: 'land' => array( 'exclude' => 1, 'label' => 'Land', 'displayCond' => 'EXT:static_info_tables_de:LOADED:true', 'con

我用于TYPO3 TCA后端国家/地区选择器、类型选择和EXT:static\u info\u tables//static\u info\u tables\u 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调试输出为=
land=>54'(2个字符)
但是,我不知道,我如何更改国家名称中的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表单找到了这个示例,但我需要正确的“国家”-名称,而不是表单选择器。

我想,我不需要“绳子”。。我需要这个:

@param \SJBR\StaticInfoTables\Domain\Repository\CountryRepository $land
谢谢你的帮助!
Sebastian

您最想做的是在域模型中建立适当的关系。您已经在TCA中设置了关系,因此调整您的模型:

/**
 * @var \SJBR\StaticInfoTables\Domain\Model\Country
 */
protected $land = '';

/**
 * @return \SJBR\StaticInfoTables\Domain\Model\Country $land
 */
public function getLand() {
    return $this->land;
}

/**
 * @param \SJBR\StaticInfoTables\Domain\Model\Country $land
 * @return void
 */  
public function setLand(\SJBR\StaticInfoTables\Domain\Model\Country $land) {
    $this->land = $land;
}
静态信息表扩展已经告诉extbase如何将数据库表映射到
\SJBR\StaticInfoTables\Domain\Model\Country
模型。 因此,在进行此更改后,您应该能够获取国家的名称

$model->getLand()->getOfficialNameLocal();

您可以检查模型,看看现在有哪些getter可供您使用。

您最想做的是在域模型中建立适当的关系。您已经在TCA中设置了关系,因此调整您的模型:

/**
 * @var \SJBR\StaticInfoTables\Domain\Model\Country
 */
protected $land = '';

/**
 * @return \SJBR\StaticInfoTables\Domain\Model\Country $land
 */
public function getLand() {
    return $this->land;
}

/**
 * @param \SJBR\StaticInfoTables\Domain\Model\Country $land
 * @return void
 */  
public function setLand(\SJBR\StaticInfoTables\Domain\Model\Country $land) {
    $this->land = $land;
}
静态信息表扩展已经告诉extbase如何将数据库表映射到
\SJBR\StaticInfoTables\Domain\Model\Country
模型。 因此,在进行此更改后,您应该能够获取国家的名称

$model->getLand()->getOfficialNameLocal();

您可以检查模型,看看现在有哪些getter可供您使用。

您使用的是extbase吗?您使用的是extbase吗?