Symfony2:无效参数异常:服务定义"templating.helpers.assets"不存在



在处理Symfony2项目时,我(似乎)在转到任何页面时都会随机得到错误InvalidArgumentException: The service definition "templating.helpers.assets" does not exist.。我试着回到以前的提交,但这并没有改变任何事情。所以它似乎不是我自己的任何源代码。我也不能composer update。我已经尝试删除缓存、供应商目录和composer.lock文件,但我仍然收到以下错误:

使用包信息加载composer存储库

更新依赖项(包括require-dev)

生成自动加载文件

更新"app/config/parameters.yml"文件

[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
服务定义"templateing.helpers.assets"不存在。

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache处理更新后cmd事件时终止,出现异常

[运行时异常]
执行"cache:clear--no warm up"命令时出错。

有什么想法吗?

FYI服务templating.helper.assets存在

php app/console container:debug  templating.helper.assets 
[container] Information for service templating.helper.assets
Service Id       templating.helper.assets
Class            SymfonyComponentTemplatingHelperCoreAssetsHelper
Tags
    - templating.helper              (alias: assets)
Scope            request
Public           yes
Synthetic        no
Lazy             no
Synchronized     no
Abstract         no

它由SymfonyBundleFrameworkBundleFrameworkBundle()创建并在Resourcesconfigtemplating_php.xml 中定义

    <service id="templating.helper.assets" class="%templating.helper.assets.class%">
        <tag name="templating.helper" alias="assets" />
        <argument /> <!-- default package -->
        <argument type="collection" /> <!-- named packages -->
    </service>

因此,将此捆绑包添加到您的appKernel.php

public function registerBundles()
{
    $bundles = array(
        //Standard
        new SymfonyBundleFrameworkBundleFrameworkBundle(),
        //others bundles

最新更新