[英]TYPO3 4.6 include extbase plugin with typoscript
我有TYPO3 4.6,在tempvoila模板中,我有錯別字對象路徑lib.header
,我想將插件的輸出重定向到lib.header
我有擴展庫和在ext_localconf.php中編寫和配置的插件,如下所示:
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'
);
在打字模板中,我有這個:
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中有什么更改嗎?
我認為問題出在你的行動上。 您的控制器中確實有一個randomPhotoSlideShowAction嗎? 還要檢查指定的pluginName是否正確。
請嘗試指定索引或列出操作,然后看看會發生什么。
action = index
switchableControllerActions {
Photo {
1 = index
}
}
如果您的操作正確,請確保您實際上從操作中返回了一些東西!
public function randomPhotoSlideShowAction(...) {
// [...]
$this->view->assign('foo', 'bar');
return $this->view->render();
}
您的代碼看起來不錯,唯一缺少的是Controller
部分(按照命名約定)
controller = PhotoController
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.