thinkphp site navigation, menu design confused?

Source: Internet
Author: User
In this way, the development of site navigation and menus have such doubts ....

1. I put the contents of the menu into the database, and the targeted generation of HTML files, easy to read. But the problem arises, I do not know how to match, for example, jump to the product center, generated HTML files, can not automatically identify, this time to re-query the database, there is no other better way?

2. Query the database to find the corresponding menu options, but how can I match the corresponding menu? To judge by the address? But will this be safe?

CREATE TABLE `#DB_PREFIX#Menu` (    `list_id` INT(11) NULL AUTO_INCREMENT,    `menu_id` VARCHAR(55) NOT NULL COMMENT '菜单值',    `sort_id` INT(11) UNSIGNED NOT NULL COMMENT '排序ID',    `parent_id` VARCHAR(55) NULL COMMENT '父类值',    `name` VARCHAR(55) NOT NULL COMMENT '菜单名称',    `title` VARCHAR(55) NOT NULL COMMENT '菜单标题',    `en` VARCHAR(55) NOT NULL COMMENT '英文菜单名称',    `icon` VARCHAR(55) NULL COMMENT '图标 / ico',    `url` VARCHAR(55) NULL COMMENT '菜单超链接',    `default` VARCHAR(255) NULL COMMENT '默认值 / 超链接',    `type` SET('On', 'Off') NOT NULL COMMENT '审核',    `published` INT(11) UNSIGNED NOT NULL COMMENT '发布时间',    PRIMARY    KEY (`list_id`),    KEY `menu_id` (`menu_id`),    KEY `sort_id` (`sort_id`),    KEY `parent_id` (`parent_id`))ENGINE=#DB_ENGINE# DEFAULT CHARSET=#DB_CODE#;

Do you have any other suggestions for the design of menus and navigation? or any other better way?

Reply content:

In this way, the development of site navigation and menus have such doubts ....

1. I put the contents of the menu into the database, and the targeted generation of HTML files, easy to read. But the problem arises, I do not know how to match, for example, jump to the product center, generated HTML files, can not automatically identify, this time to re-query the database, there is no other better way?

2. Query the database to find the corresponding menu options, but how can I match the corresponding menu? To judge by the address? But will this be safe?

CREATE TABLE `#DB_PREFIX#Menu` (    `list_id` INT(11) NULL AUTO_INCREMENT,    `menu_id` VARCHAR(55) NOT NULL COMMENT '菜单值',    `sort_id` INT(11) UNSIGNED NOT NULL COMMENT '排序ID',    `parent_id` VARCHAR(55) NULL COMMENT '父类值',    `name` VARCHAR(55) NOT NULL COMMENT '菜单名称',    `title` VARCHAR(55) NOT NULL COMMENT '菜单标题',    `en` VARCHAR(55) NOT NULL COMMENT '英文菜单名称',    `icon` VARCHAR(55) NULL COMMENT '图标 / ico',    `url` VARCHAR(55) NULL COMMENT '菜单超链接',    `default` VARCHAR(255) NULL COMMENT '默认值 / 超链接',    `type` SET('On', 'Off') NOT NULL COMMENT '审核',    `published` INT(11) UNSIGNED NOT NULL COMMENT '发布时间',    PRIMARY    KEY (`list_id`),    KEY `menu_id` (`menu_id`),    KEY `sort_id` (`sort_id`),    KEY `parent_id` (`parent_id`))ENGINE=#DB_ENGINE# DEFAULT CHARSET=#DB_CODE#;

Do you have any other suggestions for the design of menus and navigation? or any other better way?

Go to the menu through the address, but you can save the address key in a hashed manner

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.