Blogger Information
Blog 34
fans 1
comment 1
visits 40190
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
ThinkPHP6关于菜单管理知识总结
嘿哈的博客
Original
2043 people have browsed it

## 菜单管理页面 四个功能 编辑添加,删除,子菜单,返回上级菜单

一、菜单列表
前端页面(一级):

子菜单:

Javascript:

服务器端:

注释:

  1. **子菜单实现:**
  2. 通过url获取mid值,默认$mid=0,则设置查询条件 pid=$mid(pid=0) 将一级菜单列表全部查询出来
  3. 前端遍历时,给按钮做点击事件,并设置参数 例如children($mid) mid为菜单id
  4. 当点击子菜单时,url获取到的mid值,是该单条菜单的mid
  5. 查询条件pid=$mid(父级菜单id) 查询到子菜单所有数据列表
  6. **返回上级菜单实现:**
  7. 返回上级菜单按钮,设置点击事件 back($backid) 默认为0
  8. 利用父级菜单$mid 查询该菜单(mid=$mid)获取单条数据中pid
  9. pid赋值给backid
  10. 点击返回上级菜单按钮 url中获取到mid中的值为backid
  11. 再利用查询条件 pid=$mid(pid=backid) 将上级菜单查询出来 以此循环

  1. 通过urlget方式获取需要修改的mid
  2. 保存功能 post传递数据
  3. 在服务器端将传递的数据整理
  4. mid=0时,则为添加菜单 insert
  5. mid>0时,则为编辑菜单 update
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact [email protected] Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!