Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typo3 如何通过扩展管理器配置扩展(类型3)_Typo3_Content Management System_Typo3 9.x_Typo3 Extensions - Fatal编程技术网

Typo3 如何通过扩展管理器配置扩展(类型3)

Typo3 如何通过扩展管理器配置扩展(类型3),typo3,content-management-system,typo3-9.x,typo3-extensions,Typo3,Content Management System,Typo3 9.x,Typo3 Extensions,我目前正在开发自己的TYPO3扩展(在V9.5.11中),我想使扩展的一些设置可定制。当我转到管理工具-->设置-->扩展配置-->配置扩展时,我已经可以更改这些设置 但是,在早期版本的TYPO3(例如v7)中,也可以通过管理工具-->扩展-->“单击所需扩展的设置控制盘”(见图)来配置扩展 我在哪里实现上述功能?您只需在文件ext\u conf\u template.txt中定义所需的设置,该文件需要存储在扩展的根级别 包含详细说明。正如Michael所说,您需要将所有设置放入ext\u c

我目前正在开发自己的TYPO3扩展(在V9.5.11中),我想使扩展的一些设置可定制。当我转到管理工具-->设置-->扩展配置-->配置扩展时,我已经可以更改这些设置

但是,在早期版本的TYPO3(例如v7)中,也可以通过管理工具-->扩展-->“单击所需扩展的设置控制盘”(见图)来配置扩展


我在哪里实现上述功能?

您只需在文件
ext\u conf\u template.txt
中定义所需的设置,该文件需要存储在扩展的根级别


包含详细说明。

正如Michael所说,您需要将所有设置放入
ext\u conf\u template.txt

这是我的扩展名“slug”的一个示例,您也可以在上或中找到它。它包含一些特殊字段甚至翻译

# Settings
###########################

# cat=defaults; type=options[10,20,30,40,50,60,70,80,90,100,150,200,300,400,500]; label=LLL:EXT:slug/Resources/Private/Language/locallang_be.xlf:default.maxentries
defaultMaxEntries = 20

# cat=defaults; type=options[crdate,tstamp,title,slug,sys_language_uid,is_siteroot,doktype]; label=LLL:EXT:slug/Resources/Private/Language/locallang_be.xlf:default.orderby
defaultOrderBy = crdate

# cat=defaults; type=options[DESC,ASC]; label=LLL:EXT:slug/Resources/Private/Language/locallang_be.xlf:default.order
defaultOrder = DESC

# cat=defaults; type=boolean; label=LLL:EXT:slug/Resources/Private/Language/locallang_be.xlf:default.recordInfoEnabled
recordInfoEnabled = 1


# cat=tree; type=boolean; label=LLL:EXT:slug/Resources/Private/Language/locallang_be.xlf:tree.enabled
treeEnabled = 1

# cat=tree; type=options[1,2,3,4,5,6,7,8,9,10]; label=LLL:EXT:slug/Resources/Private/Language/locallang_be.xlf:tree.depth
treeDefaultDepth = 3

# cat=tree; type=string; label=LLL:EXT:slug/Resources/Private/Language/locallang_be.xlf:tree.root
treeDefaultRoot =


# cat=custom records; type=boolean; label=LLL:EXT:slug/Resources/Private/Language/locallang_be.xlf:record.enabled
recordEnabled = 0

# cat=custom records; type=options[10,20,30,40,50,60,70,80,90,100,150,200,300,400,500]; label=LLL:EXT:slug/Resources/Private/Language/locallang_be.xlf:record.maxentries
recordMaxEntries = 10

# cat=custom records; type=options[crdate,title,path_segment,sys_language_uid]; label=LLL:EXT:slug/Resources/Private/Language/locallang_be.xlf:record.orderby
recordOrderBy = crdate

# cat=custom records; type=options[DESC,ASC]; label=LLL:EXT:slug/Resources/Private/Language/locallang_be.xlf:record.order
recordOrder = DESC
以下是我如何在任何我想要的控制器中使用settigs:

<?php    
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;

class ExtensionController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {

       public function __construct() {
            $this->backendConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('slug');
       }

       public function myRandomFunction(){
           $variable = $this->backendConfiguration['recordMaxEntries'];
       }

}

扩展配置已从扩展管理器(TYPO3 7和8)移动到您已经写过的地方。管理工具-->设置-->扩展配置-->配置扩展哦,好的。因此,没有办法将漂亮的设置控制盘放入您的扩展管理器?因为在配置、下载、删除等方面仍然有完全相同的空间。扩展管理器中的配置控制盘已经使用了TYPO3 9.5。只有编写自己的TYPO3扩展才能将其恢复。