代码如上,其中compact 参数 为什么是'comments'而不是$comments?
回复内容: public function listcomment(){ $comments=comment::orderby('id','desc')->paginate(10); $this->layout->title='comment listings'; $this->layout->main=view::make('dash')->nest('content','comments.list',compact('comments')); }
代码如上,其中compact 参数 为什么是'comments'而不是$comments?
建议楼主多看看官方文档
http://php.net/manual/zh/function.compact.php
compact('comments')=$comments
