0

我目前正在使用 SonataUserBundle,当我尝试加载 /profile/ page 时,出现以下错误:

Attempted to call method "setCurrentUri" on class "Knp\Menu\MenuItem".

我在几个帖子中看到很多人通过要求 knplabs/knp-menu-bundle:1.1.* 解决了这个错误

但是当我尝试

composer require knplabs/knp-menu-bundle:1.1.*

我收到以下错误:

symfony/framework-bundle v2.0.18 requires symfony/dependency-injection v2.0.18 -> no matching package found.
- symfony/framework-bundle v2.0.17 requires symfony/dependency-injection v2.0.17 -> no matching package found.
- symfony/framework-bundle 2.0.7 requires symfony/translator 2.0.7 -> no matching package found.
- Conclusion: don't install knplabs/knp-menu-bundle v1.1.2
- Conclusion: don't install knplabs/knp-menu-bundle 1.1.x-dev
- Installation request for knplabs/knp-menu == 2.0.1.0 -> satisfiable by knplabs/knp-menu[v2.0.1].
- Conclusion: remove symfony/symfony v2.6.4
- knplabs/knp-menu-bundle v1.1.0 requires symfony/framework-bundle >=2.0,<2.2-dev -> satisfiable by symfony/symfony[2.0.x-dev, 2.1.x-dev], symfony/framework-bundle[2.0.7, 2.0.x-dev, 2.1.x-dev, v2.0.10, v2.0.12, v2.0.13, v2.0.14, v2.0.15, v2.0.16, v2.0.17, v2.0.18, v2.0.19, v2.0.20, v2.0.21, v2.0.22, v2.0.23, v2.0.24, v2.0.25, v2.0.9, v2.1.0, v2.1.1, v2.1.10, v2.1.11, v2.1.12, v2.1.13, v2.1.2, v2.1.3, v2.1.4, v2.1.5, v2.1.6, v2.1.7, v2.1.8, v2.1.9].
- knplabs/knp-menu-bundle v1.1.1 requires symfony/framework-bundle >=2.0,<2.3-dev -> satisfiable by symfony/symfony[2.0.x-dev, 2.1.x-dev, 2.2.x-dev], symfony/framework-bundle[2.0.7, 2.0.x-dev, 2.1.x-dev, 2.2.x-dev, v2.0.10, v2.0.12, v2.0.13, v2.0.14, v2.0.15, v2.0.16, v2.0.17, v2.0.18, v2.0.19, v2.0.20, v2.0.21, v2.0.22, v2.0.23, v2.0.24, v2.0.25, v2.0.9, v2.1.0, v2.1.1, v2.1.10, v2.1.11, v2.1.12, v2.1.13, v2.1.2, v2.1.3, v2.1.4, v2.1.5, v2.1.6, v2.1.7, v2.1.8, v2.1.9, v2.2.0, v2.2.1, v2.2.10, v2.2.11, v2.2.2, v2.2.3, v2.2.4, v2.2.5, v2.2.6, v2.2.7, v2.2.8, v2.2.9].
- Can only install one of: symfony/symfony[v2.6.4, 2.2.x-dev].
- Can only install one of: symfony/symfony[v2.6.4, 2.0.x-dev].
- Can only install one of: symfony/symfony[v2.6.4, 2.1.x-dev].
- don't install symfony/framework-bundle 2.2.x-dev|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.2.0|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.2.1|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.2.10|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.2.11|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.2.2|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.2.3|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.2.4|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.2.5|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.2.6|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.2.7|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.2.8|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.2.9|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle 2.1.x-dev|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.0|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.1|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.10|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.11|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.12|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.13|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.2|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.3|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.4|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.5|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.6|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.7|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.8|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.1.9|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle 2.0.x-dev|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.10|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.12|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.13|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.14|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.15|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.16|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.19|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.20|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.21|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.22|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.23|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.24|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.25|don't install symfony/symfony v2.6.4
- don't install symfony/framework-bundle v2.0.9|don't install symfony/symfony v2.6.4
- Installation request for symfony/symfony == 2.6.4.0 -> satisfiable by symfony/symfony[v2.6.4].
- Installation request for knplabs/knp-menu-bundle 1.1.* -> satisfiable by knplabs/knp-menu-bundle[1.1.x-dev, v1.1.0, v1.1.1, v1.1.2].

这是我的 composer.json

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": {
            "": "src/",
            "Application": "app/"
        }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.6.*",
        "doctrine/orm": "2.4.2",
        "doctrine/doctrine-bundle": "1.2.*",
        "doctrine/doctrine-fixtures-bundle": "2.2.*",
        "twig/extensions": "1.0.*",
        "twitter/bootstrap": "~3",
        "jquery/jquery": "1.9.1",
        "symfony/assetic-bundle": "dev-master",
        "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",
        "friendsofsymfony/user-bundle": "1.3.4",
        "sonata-project/admin-bundle": "~2.4@dev",
        "sonata-project/doctrine-orm-admin-bundle": "*",
        "sonata-project/block-bundle": "~2.2",
        "sonata-project/easy-extends-bundle": "~2.1",
        "sonata-project/user-bundle": "2.2.4",
        "sonata-project/page-bundle": "2.*",
        "predis/predis": "~0.8",
        "stof/doctrine-extensions-bundle": "~1.2@dev",
        "sonata-project/core-bundle": "dev-master"
    },
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "jquery/jquery",
                "version": "1.9.1",
                "dist": {
                    "url": "http://code.jquery.com/jquery-1.9.1.min.js",
                    "type": "file"
                }
            }
        }
    ],
    "scripts": {
        "post-install-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.3-dev"
        }
    }
}

我真的不知道该怎么做才能让 /profile/ 页面正常工作......有人知道如何解决这个问题吗?

谢谢

4

1 回答 1

0

The method "setCurrentUri" changed for "setCurrent"

https://github.com/KnpLabs/KnpMenu/issues/63

于 2015-09-15T10:09:19.040 回答