2014-10-11 11:55:32 4986次浏览 2条回答 1 悬赏 10 金钱

Unknown Method – yii\base\UnknownMethodException
Calling unknown method: yii\web\UrlManager::addRules()
初始化完以后就这样了---靠----有谁知道怎么解决吗?????

  • 回答于 2014-10-11 20:01 举报

    今天刚把这个问题解决,我是按照新的官方guide重装了个项目,然后拷贝了composer.json的内容,如下

    {
        "name": "yiisoft/yii2-app-basic",
        "description": "Yii 2 Basic Application Template",
        "keywords": ["yii2", "framework", "basic", "application template"],
        "homepage": "http://www.yiiframework.com/",
        "type": "project",
        "license": "BSD-3-Clause",
        "support": {
            "issues": "https://github.com/yiisoft/yii2/issues?state=open",
            "forum": "http://www.yiiframework.com/forum/",
            "wiki": "http://www.yiiframework.com/wiki/",
            "irc": "irc://irc.freenode.net/yii",
            "source": "https://github.com/yiisoft/yii2"
        },
        "minimum-stability": "dev",
        "require": {
            "php": ">=5.4.0",
            "yiisoft/yii2": "*",
            "yiisoft/yii2-bootstrap": "*",
            "yiisoft/yii2-swiftmailer": "*"
        },
        "require-dev": {
            "yiisoft/yii2-codeception": "*",
            "yiisoft/yii2-debug": "*",
            "yiisoft/yii2-gii": "*",
            "yiisoft/yii2-faker": "*"
        },
        "config": {
            "process-timeout": 1800
        },
        "scripts": {
            "post-create-project-cmd": [
                "yii\\composer\\Installer::postCreateProject"
            ]
        },
        "extra": {
            "yii\\composer\\Installer::postCreateProject": {
                "setPermission": [
                    {
                        "runtime": "0777",
                        "web/assets": "0777",
                        "yii": "0755"
                    }
                ],
                "generateCookieValidationKey": [
                    "config/web.php"
                ]
            },
            "asset-installer-paths": {
                "npm-asset-library": "vendor/npm",
                "bower-asset-library": "vendor/bower"
            }
        }
    }
    
    

    1.在项目外部执行:composer global require "fxp/composer-asset-plugin:1.0.0-beta2"
    2.进入项目根目录,把刚拷贝的内容替换composer.json的内容,然后执行:composer update --prefer-dist,此处应该会让你填写Git账号,之前没有的,要到Git官网注册一个账号,按提示输入用户名密码就ok了

  • 回答于 2014-12-16 12:02 举报

    没有解决我遇到的问题。。。

    1 条回复
    回复于 2014-12-25 13:54 回复

    ok--哈哈哈哈哈

您需要登录后才可以回答。登录 | 立即注册
xing18c
总监

xing18c 深圳

注册时间:2014-03-15
最后登录:2016-03-08
在线时长:41小时47分
  • 粉丝11
  • 金钱1843
  • 威望0
  • 积分2253

热门问题