[英]symfony2 sonata page bundle error
How to install sonata page-bundle? 如何安装奏鸣曲页面捆绑?
My composer.json: 我的composer.json:
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "~1.2",
"doctrine/doctrine-migrations-bundle": "dev-master",
"doctrine/migrations": "dev-master",
"doctrine/doctrine-fixtures-bundle": "~2.2",
"doctrine/data-fixtures": "1.0.*@dev",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"incenteev/composer-parameter-handler": "~2.0",
"jms/security-extra-bundle": "1.5.*",
"jms/di-extra-bundle": "1.4.*",
"kriswallsmith/assetic": "1.1.0",
"liip/imagine-bundle": "dev-master",
"egeloen/ckeditor-bundle": "2.*",
"symfony-cmf/routing-bundle": "~1.1",
"knplabs/knp-markdown-bundle": "1.2.*@dev",
"sonata-project/easy-extends-bundle": "~2.1",
"sonata-project/seo-bundle": "~1",
"sonata-project/doctrine-extensions": "~1",
"sonata-project/intl-bundle": "~2.1",
"sonata-project/admin-bundle": "~2.2",
"sonata-project/doctrine-orm-admin-bundle": "~2.2",
"sonata-project/notification-bundle": "~2.2",
"sonata-project/block-bundle": "~2.2",
"sonata-project/media-bundle": "~2.2",
"sonata-project/cache-bundle": "~2.1",
"sonata-project/page-bundle": "~2.3",
"sonata-project/formatter-bundle": "~2.3",
"sonata-project/exporter": "~1.3",
"sonata-project/classification-bundle": "~2.2",
"dflydev/markdown": "~1.0",
"simplethings/entity-audit-bundle": "~0.5",
"willdurand/faker-bundle": "~1.0",
"stof/doctrine-extensions-bundle": "~1.1"
},
My AppKernel.php: 我的AppKernel.php:
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
// DOCTRINE
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
// KNP HELPER BUNDLES
// new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(),
// MEDIA
new Sonata\MediaBundle\SonataMediaBundle(),
new Application\Sonata\MediaBundle\ApplicationSonataMediaBundle(),
new Liip\ImagineBundle\LiipImagineBundle(),
// SONATA CORE & HELPER BUNDLES
new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
new Sonata\jQueryBundle\SonatajQueryBundle(),
new Sonata\AdminBundle\SonataAdminBundle(),
new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
new Sonata\IntlBundle\SonataIntlBundle(),
new Sonata\FormatterBundle\SonataFormatterBundle(),
new Sonata\CacheBundle\SonataCacheBundle(),
new Sonata\BlockBundle\SonataBlockBundle(),
new Sonata\SeoBundle\SonataSeoBundle(),
new Sonata\PageBundle\SonataPageBundle(),
new Application\Sonata\PageBundle\ApplicationSonataPageBundle(),
new Sonata\ClassificationBundle\SonataClassificationBundle(),
new Application\Sonata\ClassificationBundle\ApplicationSonataClassificationBundle(),
new Sonata\NotificationBundle\SonataNotificationBundle(),
new Application\Sonata\NotificationBundle\ApplicationSonataNotificationBundle(),
// CMF Integration
new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
And when i create "block" found error: 当我创建“块”时发现错误:
Catchable Fatal Error: Argument 3 passed to Sonata\DoctrineORMAdminBundle\Block\AuditBlockService::__construct() must be an instance of SimpleThings\EntityAudit\AuditReader, null given, called in /var/www/xxx/app/cache/dev/appDevDebugProjectContainer.php on line 4911 and defined in /var/www/xxx/vendor/sonata-project/doctrine-orm-admin-bundle/Sonata/DoctrineORMAdminBundle/Block/AuditBlockService.php line 40
After then, add " SimpleThings\\EntityAudit\\SimpleThingsEntityAuditBundle() " to AppKernel, and found: 之后,将“ SimpleThings \\ EntityAudit \\ SimpleThingsEntityAuditBundle() ”添加到AppKernel,然后找到:
ContextErrorException: Notice: Uninitialized string offset: 0 in /var/www/xxx/vendor/sonata-project/doctrine-orm-admin-bundle/Sonata/DoctrineORMAdminBundle/DependencyInjection/Compiler/AddAuditEntityCompilerPass.php line 63
What is wrong? 怎么了?
When installing SonataPageBundle, you have a set of dependencies that need to be installed and properly configured, see the list here: http://sonata-project.org/bundles/page/master/doc/reference/installation.html 在安装SonataPageBundle时,您需要安装和正确配置一组依赖项,请参见此处的列表: http : //sonata-project.org/bundles/page/master/doc/reference/installation.html
You need to check out the installation steps of each specified bundle. 您需要检查每个指定捆绑软件的安装步骤。
For the details: 有关详细信息:
The SimpleThingsEntityAuditBundle is used by the DoctrineORMAdminBundle to automatically audit the doctrine-managed entities that have an admin interface. DoctrineORMAdminBundle使用SimpleThingsEntityAuditBundle来自动审核具有管理界面的受理论管理的实体。
There it seems that you've created an admin class (a service tagged "sonata.admin") without specifying the needed arguments for the admin (or without inheriting the default admin). 似乎您已经创建了一个admin类(标记为“ sonata.admin”的服务),而没有为admin指定所需的参数(或者没有继承默认的admin)。
If you didn't, try clearing your cache: 如果没有,请尝试清除缓存:
rm -rf app/cache/*
You may have an outdated container. 您可能有一个过时的容器。
If this doesn't work, check your services tagged "sonata.admin" to see if they have the required arguments. 如果这不起作用,请检查标记为“ sonata.admin”的服务,以查看它们是否具有必需的参数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.