Tp5 paging problem

problem description

Page-by-page rendering to html page, tag cannot be rendered, surrounded by ""

related codes

/ / Please paste the code text below (do not replace the code with pictures)

   //model
   public function getFirstCategory($parentId = 0) {
      $data = [
        "parent_id" => $parentId,
        "status" => [0, 1],
      ];

      $order = [
        "id" => "desc"
      ];
      $result = $this->where($data)->order($order)->paginate(2);
      return $result;
    }
    //controller
   public function index()
    {
        $parentId = input("get.parent_id",0,"intval");
        $categorys = model("Category") -> getFirstCategory($parentId);
        $list = $categorys->render();

        return $this -> fetch("",[
            "categorys" => $categorys,
            "list" => $list
        ]);
    }
//html
<div>{$list}</div>

result

clipboard.png

the html code is not rendered, but is displayed as text

Php
Aug.27,2021

use {$list | raw} THINKPHP5 paging

Menu