多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
和前面一样,我们要在 app/controllers/ArticlesController.php 文件中更改 show 动作,以及相应的视图文件。 ~~~ public function show($id) { $article = Article::find($id); return View::make('articles.show', compact('article')); } ~~~ 然后,新建 app/views/articles/show.blade.php 文件,写入下面的代码: ~~~ <p> <strong>Title:</strong> {{ $article->title }} </p> <p> <strong>Text:</strong> {{ $article->text }} </p> ~~~ 做了以上修改后,就能真正的新建文章了。访问 http://localhost:8000/articles/create ,自己试试。