PHP Framework queryphp Tutorial: Getting Started Eight by jumping
Route description
Path_info Way
Testframework.php?router=default&action=index
Testframework.php/default/index?
You can use Apache rewrite to remove testframework.php files
You can set up your own routing rules
C ("router")->rulemaps ("Login", '/login/:id ', Array (' controller ' = ' auth ', ' action ' = ' login '));
Then it will be a testframework.php/login/5555.
This allows the use of $_get[' ID '] to get 5555;
' Controller ' = ' auth ', ' action ' = ' login '
is the controller and method
Other settings can add your own defined routing rules:
C ("router")->rulemaps (' logout ', '/logout ', Array (' controller ' = ' auth ', ' action ' = ' logout '));
C ("router")->rulemaps (' Signup ', '/signup ', Array (' controller ' = ' auth ', ' action ' = ' signup '));
C ("router")->rulemaps (' profile ', '/profile/:action ', Array (' controller ' = ' profile ')); Would call controller ' profile ' with dynamic method ': Action () '
C ("router")->rulemaps (' Users ', '/users/:id ', Array (' controller ' = ' users '), array (' id ' = ' = ' [\d]{1,8} ')]; Define filters for the URL parameters
Support Path_info Mode
Control action under the router directory
/default/index
Call the router directory under the defaultRouter.class.php file
Call Index mode after getting class
- J () is the index method jump
- R () is controlled by the
- C () is the generated class
- M () is the database class model?
- P () is the load path function