初始化报错 [ 未指定版本 ]
Unknown Method – yii\base\UnknownMethodException
Calling unknown method: yii\web\UrlManager::addRules()
初始化完以后就这样了---靠----有谁知道怎么解决吗?????
共 2 个回答
-
今天刚把这个问题解决,我是按照新的官方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了
xing18c 深圳
注册时间:2014-03-15
最后登录:2016-03-08
在线时长:41小时47分
最后登录:2016-03-08
在线时长:41小时47分
- 粉丝11
- 金钱1843
- 威望0
- 积分2253