fastadmin后台中文章分类ID改为名称显示
首先找到你当前的文章类后台控制器。
一般在application/admin/controller 下面
先添加模型use app\admin\model\Type as TypeModel;
然后覆盖index方法
public function index()
{
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax())
{
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField'))
{
return $this->select

本文介绍如何在FastAdmin后台将文章分类ID转换为对应的分类名称进行显示。通过覆盖控制器的index方法并利用TypeModel获取分类名称,再通过前端JS调整显示方式。
最低0.47元/天 解锁文章
1495

被折叠的 条评论
为什么被折叠?



