Plugins TYPO3 4.6包括带有typoscript的extbase插件
我有TYPO3 4.6,在tempvoila模板中我有typoscript对象路径Plugins TYPO3 4.6包括带有typoscript的extbase插件,plugins,typo3,typoscript,extbase,Plugins,Typo3,Typoscript,Extbase,我有TYPO3 4.6,在tempvoila模板中我有typoscript对象路径lib.header,我想要 将插件的输出重定向到lib.header 我在ext_localconf.php中编写并配置了扩展库和插件,如下所示: Tx_Extbase_Utility_Extension::configurePlugin( $_EXTKEY, 'RandomPhotoSlideShow', array( 'Photo' => 'randomPhotoSlid
lib.header
,我想要
将插件的输出重定向到lib.header
我在ext_localconf.php中编写并配置了扩展库和插件,如下所示:
Tx_Extbase_Utility_Extension::configurePlugin(
$_EXTKEY,
'RandomPhotoSlideShow',
array(
'Photo' => 'randomPhotoSlideShow',
),
// non-cacheable actions
array(
'Photo' => ''
)
);
Tx_Extbase_Utility_Extension::registerPlugin(
$_EXTKEY,
'RandomPhotoSlideShow',
'Gets random photos for slide show'
);
在ext_tables.php中,如下所示:
Tx_Extbase_Utility_Extension::configurePlugin(
$_EXTKEY,
'RandomPhotoSlideShow',
array(
'Photo' => 'randomPhotoSlideShow',
),
// non-cacheable actions
array(
'Photo' => ''
)
);
Tx_Extbase_Utility_Extension::registerPlugin(
$_EXTKEY,
'RandomPhotoSlideShow',
'Gets random photos for slide show'
);
在打字稿模板中,我有以下内容:
plugin.tx_gallery.widgets {
papaWidget = USER
papaWidget {
userFunc = tx_extbase_core_bootstrap->run
pluginName = RandomPhotoSlideShow
extensionName = Gallery
controller = Photo
action = randomPhotoSlideShow
switchableControllerActions {
Photo {
1 = randomPhotoSlideShow
}
}
settings =< plugin.tx_gallery.settings
persistence =< plugin.tx_gallery.persistence
view =< plugin.tx_gallery.view
}
}
lib.header < plugin.tx_gallery.widgets.papaWidget
plugin.tx\u gallery.widgets{
papaWidget=用户
木瓜{
userFunc=tx\u extbase\u core\u引导->运行
pluginName=RandomPhotoSlideShow
extensionName=Gallery
控制器=照片
动作=随机显示
可切换控制器动作{
照片{
1=随机光滑显示
}
}
设置=
但是没有显示任何内容,是否有人能告诉我哪里有错误,或者如果TYPO3 4.6中包含的extbase 1.4中有更改?您的代码看起来不错,唯一缺少的是
您的代码看起来不错,唯一缺少的是中的
控制器
部分(根据命名约定)
我认为问题在于你的行动。你的控制器中真的有一个随机动作吗? 还要检查指定的pluginName是否正确 请尝试指定索引或列表操作,看看会发生什么
action = index
switchableControllerActions {
Photo {
1 = index
}
}
如果你的行为是正确的,请确保你确实从你的行为中返回了一些东西
public function randomPhotoSlideShowAction(...) {
// [...]
$this->view->assign('foo', 'bar');
return $this->view->render();
}
我认为问题在于你的行动。你的控制器中真的有一个随机动作吗? 还要检查指定的pluginName是否正确 请尝试指定索引或列表操作,看看会发生什么
action = index
switchableControllerActions {
Photo {
1 = index
}
}
如果你的行为是正确的,请确保你确实从你的行为中返回了一些东西
public function randomPhotoSlideShowAction(...) {
// [...]
$this->view->assign('foo', 'bar');
return $this->view->render();
}
谢谢,但正如我在这里和这里发现的,不应该有控制器部分,我也尝试了,但没有成功谢谢,但正如我在这里和这里发现的,不应该有控制器部分,我也尝试了,但没有成功谢谢:),我有随机的PhotoslideShowAction,但我没有给出返回值:),现在一切都好了,我没有意识到渲染视图必须返回谢谢:),我有randomPhotoSlideShowAction,但我没有给出返回值:),现在一切都好了,我没有意识到渲染视图必须返回