简体   繁体   English

TYPO3 4.5 extbase测试后端模块

[英]TYPO3 4.5 extbase test backend module

I search for a way to test my extbase-extension. 我正在寻找一种测试我的extbase扩展的方法。 I work with two different templatepaths for front- and backend. 我为前端和后端使用两种不同的模板路径。

module.myext{
    view {
        templateRootPath = myext/Resources/Private/Backend/Templates/
        partialRootPath = myext/Resources/Private/Backend/Partials/
        layoutRootPath = myext/Resources/Private/Backend/Layouts/
    }
}

The backendmodule works without any problem, but my test will not get the different templatepath. backendmodule可以正常工作,但是我的测试不会得到不同的templatepath。 If i write the view.templateRootPath to config.tx_extbase in the ext_typoscript_setup.txt it works, but in this case all my frontendtests do not work any more. 如果我在ext_typoscript_setup.txt中将view.templateRootPath写入config.tx_extbase,它将起作用,但是在这种情况下,我所有的前端测试都不再起作用。 The simplest way to resolve this issue is to merge the templatepaths and work with only one, but there must be a way around this solution. 解决此问题的最简单方法是合并模板路径并仅使用其中的一个,但是必须有解决此问题的方法。

Does somebody has an idea? 有人有主意吗?

Did you statically include the extension setup in your root page? 您是否在根页面中静态添加了扩展程序设置?

Then the backend module should work as long as you include it in the web tools and select the root page in the page-tree... 然后,只要您将后端模块包含在Web工具中并在页面树中选择根页面,后端模块就应该起作用。

If you include your module in the user tools, this is a known bug. 如果将模块包含在用户工具中,则这是一个已知的错误。 See here: 看这里:

http://lists.typo3.org/pipermail/typo3-project-typo3v4mvc/2011-December/011174.html http://lists.typo3.org/pipermail/typo3-project-typo3v4mvc/2011-December/011174.html

You could put this code in your *ext_localconf.php*: 您可以将此代码放在您的* ext_localconf.php *中:

if (TYPO3_MODE === 'BE') {
    t3lib_extMgm::addTypoScript($_EXTKEY, 'constants', $tsIncludeConstants);
    t3lib_extMgm::addTypoScript($_EXTKEY, 'setup', $tsIncludeSetup);
}

where $tsIncludeXX is your TS code to include the configuration files of your extension: 其中$tsIncludeXX是用于包含扩展程序配置文件的TS代码:

$tsIncludeConstants = "<INCLUDE_TYPOSCRIPT: source=FILE:EXT:$_EXTKEY/Configuration/TypoScript/constants.txt>";
$tsIncludeSetup = "<INCLUDE_TYPOSCRIPT: source=FILE:EXT:$_EXTKEY/Configuration/TypoScript/setup.txt>";

This is kind of brute force, but it works... 这是一种蛮力,但是行得通...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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