用PHP7安装sonata bundle

时间:2016-09-09 11:23:29

标签: php symfony

我试图在Windows中安装带有PHP7的奏鸣曲,但没有运气。我没有composer.phar

步骤: 1. php -r“file_put_contents('symfony',file_get_contents('https://symfony.com/installer'));”

  1. php symfony new my_project 2.8

  2. 作曲家需要sonata-project / admin-bundle

  3. composer需要sonata-project / doctrine-orm-admin-bundle 我有兼容性问题,所以,我在第5步之后重复3和4
  4. php composer.phar需要“sensio / generator-bundle”“~2.3”--dev
  5. 更新app / kernel.php new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Sonata\CoreBundle\SonataCoreBundle(), new Sonata\BlockBundle\SonataBlockBundle(), new Knp\Bundle\MenuBundle\KnpMenuBundle(), new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(), new Sonata\AdminBundle\SonataAdminBundle(),

    更新app / config / config.yml

    sonata_block:
    default_contexts: [cms]
    blocks:
        # enable the SonataAdminBundle block
        sonata.admin.block.admin_list:
            contexts: [admin]
    

    更新app / config / routing.yml

    admin_area:
    resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.xml"
    prefix: /admin
    

    最后:

    php app/console cache:clear
    php app/console assets:install
    

    但是,我无法在浏览器中看到我的管理员。

     "require": {
        "php": ">=5.3.9",
        "symfony/symfony": "2.8.*",
        "doctrine/orm": "^2.4.8",
        "doctrine/doctrine-bundle": "~1.4",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~5.0",
        "sensio/framework-extra-bundle": "^3.0.2",
        "incenteev/composer-parameter-handler": "~2.0",
        "sonata-project/admin-bundle": "2.3.*"
    

0 个答案:

没有答案