无法确定扩展中第二个插件的默认控制器
Default controller of 2nd plugin in extension can not be determined
我在 TYPO3 6.2 中使用 extension builder 制作了一个 extbase 扩展,到目前为止我有一个可用的前端插件。但是现在我想添加另一个可以使用与该扩展相同的 类 的插件,但我什至无法成功添加它。
当点击应该显示我的新插件的页面时,我收到了这个错误:
Caught exception: The default controller for extension ...
and plugin "Stats" can not be determined. Please check for
TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin() in your
ext_localconf.php.
这是我之前做的:
在扩展构建器中添加新插件 "Stats" 后,我在 ext_localconf.php:
中看到以下代码
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'CC.' . $_EXTKEY,
'Appoints',
array(
'Appointment' => 'list, show, new, create, edit',
'Feedback' => 'new, create, list',
),
// non-cacheable actions
array(
'Appointment' => 'list, show, new, create, edit',
'Feedback' => 'new, create, list',
)
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'CC.' . $_EXTKEY,
'Stats',
array(
'Appointment' => 'statistic',
),
// non-cacheable actions
array(
'Appointment' => 'statistic',
)
);
在 ext_tables.php 我得到:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'CC.' . $_EXTKEY,
'Appoints',
'Appointments'
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'CC.' . $_EXTKEY,
'Stats',
'Statstics'
);
似乎扩展构建器完美地完成了所有事情。
在我的AppointmentController.php
(命名空间正确 - namespace Vendor\Extname\Controller;
)我添加了:
public function statisticAction() {
echo "testing";
}
然后我在后端将新插件添加到我的页面。 (请忽略图片中的拼写错误我已经更正了但它不是我问题的原因)
那么可能是什么原因呢?我怎样才能最简单地解决这个问题?
我是否应该在扩展构建器中的 switchableControllerActions
中输入一些内容,因为我对两个插件使用相同的控制器但操作不同?如果是 - 什么?
EDIT: I found out it must have something to do with my backend page, idk what - but if I change the plugin on the same page it works,...I'm searching for the causing differences between the two pages that might cause this...
您在声明第二个插件
时在 ext_localconf.php 中输入了错误
"Stats": \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'CC.' . $_EXTKEY,
'Stats',
array(
'Appointment' => 'statistic', ==> 'Statistics' => 'statistic'
),
// non-cacheable actions
array(
'Appointment' => 'statistic', ==> 'Statistics' => 'statistic'
)
);
因为 "Statistics" 是该插件的正确控制器名称,如果您将其命名为 "StatisticsController"。
就像评论中的每个人一样,我所做的一切都是正确的并且应该有效...
我注意到我的插件在一个后端页面上工作,但在另一个后端页面上不起作用。
由于我找不到导致此问题的这两个页面之间的任何差异,我删除了它们并创建了两个新页面,在每个页面中插入一个插件。
现在可以使用了...如果您遇到类似问题,我的解决方案是:
在试图深入挖掘原因之前,只需尝试删除有问题的后端页面并创建一个新页面。也许它可以解决问题,它为我做到了。
我在 TYPO3 6.2 中使用 extension builder 制作了一个 extbase 扩展,到目前为止我有一个可用的前端插件。但是现在我想添加另一个可以使用与该扩展相同的 类 的插件,但我什至无法成功添加它。
当点击应该显示我的新插件的页面时,我收到了这个错误:
Caught exception: The default controller for extension ... and plugin "Stats" can not be determined. Please check for TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin() in your ext_localconf.php.
这是我之前做的:
在扩展构建器中添加新插件 "Stats" 后,我在 ext_localconf.php:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'CC.' . $_EXTKEY,
'Appoints',
array(
'Appointment' => 'list, show, new, create, edit',
'Feedback' => 'new, create, list',
),
// non-cacheable actions
array(
'Appointment' => 'list, show, new, create, edit',
'Feedback' => 'new, create, list',
)
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'CC.' . $_EXTKEY,
'Stats',
array(
'Appointment' => 'statistic',
),
// non-cacheable actions
array(
'Appointment' => 'statistic',
)
);
在 ext_tables.php 我得到:
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'CC.' . $_EXTKEY,
'Appoints',
'Appointments'
);
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
'CC.' . $_EXTKEY,
'Stats',
'Statstics'
);
似乎扩展构建器完美地完成了所有事情。
在我的AppointmentController.php
(命名空间正确 - namespace Vendor\Extname\Controller;
)我添加了:
public function statisticAction() {
echo "testing";
}
然后我在后端将新插件添加到我的页面。 (请忽略图片中的拼写错误我已经更正了但它不是我问题的原因)
那么可能是什么原因呢?我怎样才能最简单地解决这个问题?
我是否应该在扩展构建器中的 switchableControllerActions
中输入一些内容,因为我对两个插件使用相同的控制器但操作不同?如果是 - 什么?
EDIT: I found out it must have something to do with my backend page, idk what - but if I change the plugin on the same page it works,...I'm searching for the causing differences between the two pages that might cause this...
您在声明第二个插件
时在 ext_localconf.php 中输入了错误 "Stats": \TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
'CC.' . $_EXTKEY,
'Stats',
array(
'Appointment' => 'statistic', ==> 'Statistics' => 'statistic'
),
// non-cacheable actions
array(
'Appointment' => 'statistic', ==> 'Statistics' => 'statistic'
)
);
因为 "Statistics" 是该插件的正确控制器名称,如果您将其命名为 "StatisticsController"。
就像评论中的每个人一样,我所做的一切都是正确的并且应该有效...
我注意到我的插件在一个后端页面上工作,但在另一个后端页面上不起作用。
由于我找不到导致此问题的这两个页面之间的任何差异,我删除了它们并创建了两个新页面,在每个页面中插入一个插件。
现在可以使用了...如果您遇到类似问题,我的解决方案是:
在试图深入挖掘原因之前,只需尝试删除有问题的后端页面并创建一个新页面。也许它可以解决问题,它为我做到了。