TYPO3 4.6包括extbase插件与的TypoScript
我有TYPO3 4.6,在tempvoila模板我有Typo脚本对象路径lib.header
,我想 到插件的输出重定向到lib.header
我有扩展廊和插件写入并在ext_localconf.php配置等这样的:TYPO3 4.6包括extbase插件与的TypoScript
Tx_Extbase_Utility_Extension::configurePlugin(
$_EXTKEY,
'RandomPhotoSlideShow',
array(
'Photo' => 'randomPhotoSlideShow',
),
// non-cacheable actions
array(
'Photo' => ''
)
);
在ext_tables.php这样的:
Tx_Extbase_Utility_Extension::registerPlugin(
$_EXTKEY,
'RandomPhotoSlideShow',
'Gets random photos for slide show'
);
和模板的TypoScript我有这样的:
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
但是什么都没有显示,有人请指教我在哪里有错误,或者如果在TYPO3 4.6中包含的extbase 1.4有所改变?
我认为这个问题是你的行动。你的控制器中是否真的有一个随机的PhotoSlideShowAction? 同时检查指定的pluginName是否正确。
请尝试指定您的索引或列表操作,看看会发生什么。
action = index
switchableControllerActions {
Photo {
1 = index
}
}
如果你的行为是正确的,确保你实际上从你的行动中返回了一些东西!
public function randomPhotoSlideShowAction(...) {
// [...]
$this->view->assign('foo', 'bar');
return $this->view->render();
}
您的代码看起来不错,唯一缺少的是Controller
部分(按命名约定)在
controller = PhotoController
谢谢,但我发现这里http://www.adick.at/2011-07-01,extbase-plugins-mit-typoscript-einbinden/这里http://www.adick.at/2011-07-01,extbase-plugins-mit-typoscript-einbinden /不应该有控制器部分我也试过但没有成功 – anjalis 2012-01-06 23:50:42
非常感谢:),我有randomPhotoSlideShowAction那里,但我不给那里回报值:),现在一切都好,我没有意识到必须返回呈现的视图 – anjalis 2012-01-09 19:54:42