在我的Symfony2项目中,我(似乎)在访问任何页面时随机获得了错误InvalidArgumentException: The service definition "templating.helpers.assets" does not exist.。我试过回到以前的提交,但这并没有改变任何事情。所以它似乎不是我自己的任何源代码。我也不能composer update。我已尝试删除缓存、供应商目录和composer.lock文件,但仍然收到以下错误:
用包信息加载composer存储库 更新依赖项(包括require) 自动生成文件 更新“app/config/parameters.yml s.yml”文件 Symfony\Component\DependencyInjection\Exception\InvalidArgumentException 服务定义"templating.helpers.assets“不存在。脚本Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache处理以异常终止的后更新-cmd事件。 RuntimeException 执行“缓存:清除-不热身”命令时发生错误。
有什么想法吗?
发布于 2015-05-12 16:18:42
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 Symfony\Component\Templating\Helper\CoreAssetsHelper
Tags
- templating.helper (alias: assets)
Scope request
Public yes
Synthetic no
Lazy no
Synchronized no
Abstract no它由Symfony\Bundle\FrameworkBundle\FrameworkBundle()创建,并在Resources\config\templating_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 Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
//others bundleshttps://stackoverflow.com/questions/26239458
复制相似问题