[PHP]How to create database-supported dynamic routes?

100 Views Asked by At

I'm coding a script. I use altorouter as the route, but I want to add database support. Why Database support? 1.My script support template system with altorouter. Route define route name.

Content DB structure

    cont_id int 11 Primary Key AI 
    cont_title varchar 150
    cont_desc varchar 255
    cont_body text
    cont_thumb int 11
    cont_addUser int 11 

Content_tax DB structure

post_id int 11 
link_id int 11 
post_type varchar 60

Link DB structure

link_pid int 11 Primary Key 11 ai
link_url varchar 150
link_name varchar 100

Altorouter simple fast routing but maybe not dynamic with database

$router->map( 'GET|POST', '/users/[i:id]/', function( $id ) {
  $user = .....
  require __DIR__ . '/views/user/details.php';
});

How can we create a database-supported route system? or how can I make the altorouter route system with dynamic database support? Note :Please don't give negative points I may not be able to explain it exactly. Ask what you wonder. Help solve this problem.

0

There are 0 best solutions below