首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >龙骨脚手架

龙骨脚手架
EN

Stack Overflow用户
提问于 2015-05-30 13:35:08
回答 1查看 770关注 0票数 3

我对laravel很陌生,并且用这个插件创建了一个“文章”支架:

https://github.com/JeffreyWay/Laravel-4-Generators

和跑步:

代码语言:javascript
复制
php artisan generate:resource article --fields="title:string, body:text"

一切正常,在我的数据库中创建了表,相关的文件出现在我的项目目录中。但是,当我导航到localhost/laravel/public/ when (我的目录)时,我会得到以下错误:

代码语言:javascript
复制
ErrorException (E_NOTICE)
HELP
Undefined offset: 1
Open: C:\xampp\htdocs\laravel\vendor\laravel\framework\src\Illuminate\Routing\Router.php
            $route = $this->current();

            $request = $this->getCurrentRequest();

            // Now we can split the controller and method out of the action string so that we
            // can call them appropriately on the class. This controller and method are in
            // in the Class@method format and we need to explode them out then use them.
            list($class, $method) = explode('@', $controller);

            return $d->dispatch($route, $request, $class, $method);

我试着跑

代码语言:javascript
复制
php artisan optimize --force

但这没什么用。

有什么建议吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-05-31 10:20:39

您必须为这样的文章添加路由:

代码语言:javascript
复制
Route::resource('articles', 'ArticlesController');

在app/Broades.php文件中。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30546819

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档