In the thinkphp5 course, using paginate() in the controller prompts that the attributes of the class do not exist.
北岛初晴
北岛初晴 2017-11-20 11:10:33
0
2
1966

Video Tutorial http://www.php.cn/course/631.html In Chapter 5, Section 3, use paging to display classification information. In this video,

according to the video Write $cate_list=Menu::paginate(10); when used on the template page, it will prompt that the attribute of class

does not exist: app\menu\model\Menu->id

The namespace and think references are the same as in the previous section

$cate=Menu::getTree(); You can use

$cate_list= on the template page Menu::paginate(10); will report an error when used in a template


北岛初晴
北岛初晴

reply all(2)
北岛初晴

menu:: is the class Menu in the model and is written in the controller as Menu::method();

又白又帅又可爱

$cate_list=Menu::paginate(10);

I don’t know what the Menu here is.

The object must be obtained before calling paginate(10), that is to say You need to query first and then paginate the result objects

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template