我试图在Windows中安装带有PHP7的奏鸣曲,但没有运气。我没有composer.phar
步骤: 1. php -r“file_put_contents('symfony',file_get_contents('https://symfony.com/installer'));”
php symfony new my_project 2.8
作曲家需要sonata-project / admin-bundle
更新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.*"