【发布时间】:2018-11-03 08:32:04
【问题描述】:
我想向 TYPO3 文件集合添加其他字段。
我尝试使用this Documentation 并将我的字段添加到 TCA 和 DB。
只要我只在后端,它就可以正常工作。但在 Fluid 中,我无法访问我的新闻字段。
下一步是我尝试扩展模型以使我的字段具有 getter 和 setter,并将 extbase 设置为使用我的模型类。但是 TYPO3 忽略了它。
StaticFileCollection.php
class StaticFileCollection extends \TYPO3\CMS\Core\Resource\Collection\StaticFileCollection
{
/**
* Subheader
*
* @var string
*/
protected $subheader = '';
/**
* Returns the subheader
*
* @return string $subheader
*/
public function getSubheader()
{
return $this->subheader;
}
/**
* Sets the subheader
*
* @param string $subheader
* @return void
*/
public function setSubheader($subheader)
{
$this->subheader = $subheader;
}
}
setup.txt
config.tx_extbase {
objects {
TYPO3\CMS\Core\Resource\Collection\StaticFileCollection {
className = MyNamespace\MyExtension\Domain\Model\StaticFileCollection
}
}
}
我错过了什么?
【问题讨论】: