使用Route注释的路径格式错误。 debug:route表在预期位置之前显示<href =>

时间:2019-06-06 11:16:15

标签: path router symfony4

在Symfony 4.3.0的全新安装中,安装一些捆绑软件并使用make:user和make:auth创建基本身份验证后,我得到以下路由表。

$ ./bin/console debug:route
-------------------------- -------- -------- ------ -------------------------------------
Name                       Method   Scheme   Host   Path
-------------------------- -------- -------- ------ -------------------------------------
_twig_error_test           ANY      ANY      ANY    /_error/{code}.{_format}
_wdt                       ANY      ANY      ANY    /_wdt/{token}
_profiler_home             ANY      ANY      ANY    /_profiler/
....
app_login                  ANY      ANY      ANY    <href=>/login
api_entrypoint             ANY      ANY      ANY    /api/{index}.{_format}
api_doc                    ANY      ANY      ANY    /api/docs.{_format}
api_jsonld_context         ANY      ANY      ANY    /api/contexts/{shortName}.{_format}
-------------------------- -------- -------- ------ -------------------------------------

http://localhost:8080加载默认的symfony空白页,但未找到/ login页(无错误)。

我的composer.json看起来像这样:

{
    "type": "project",
    "license": "proprietary",
    "require": {
        "php": "^7.1.3",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "api-platform/api-pack": "^1.2",
        "sensio/framework-extra-bundle": "^5.3",
        "symfony/console": "4.3.*",
        "symfony/dotenv": "4.3.*",
        "symfony/flex": "^1.1",
        "symfony/framework-bundle": "4.3.*",
        "symfony/orm-pack": "^1.0",
        "symfony/security-bundle": "4.3.*",
        "symfony/webpack-encore-bundle": "^1.6",
        "symfony/yaml": "4.3.*"
    },
    "config": {
        "preferred-install": {
            "*": "dist"
        },
        "sort-packages": true
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "replace": {
        "paragonie/random_compat": "2.*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*",
        "symfony/polyfill-php56": "*"
    },
    "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd",
            "security-checker security:check": "script"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ]
    },
    "conflict": {
        "symfony/symfony": "*"
    },
    "extra": {
        "symfony": {
            "allow-contrib": false,
            "require": "4.3.*"
        }
    },
    "require-dev": {
        "sensiolabs/security-checker": "^5.0",
        "symfony/debug-pack": "^1.0",
        "symfony/maker-bundle": "^1.11",
        "symfony/phpunit-bridge": "4.3.*",
        "symfony/profiler-pack": "^1.0"
    }
}

清除缓存无效。 降级到4.2.9解决了这个问题。

我该怎么做才能在4.3中工作?

0 个答案:

没有答案