繁体   English   中英

TYPO3 4.6包含带有错字的extbase插件

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM