PHP framework queryphp course: Getting started

Source: Internet
Author: User
PHP framework queryphp Tutorial: Entry 8 route jump instructions path_info testframework. php? Router = default & amp; action = indextestframework. php/default/I PHP framework queryphp Tutorial: Entry 8 route jump

Route description

Path_info mode

Testframework. php? Router = default & action = indextestframework. php/default/index?

You can use apache to rewrite and remove the testframework. php file.

You can set routing rules yourself.

C ("router")-> ruleMaps ("login", '/login/: ID', array ('controller' => 'auth ', 'action' => 'login '));

Testframework. php/login/5555

In this way, you can use $ _ GET ['id'] to GET 5555;

'Controller' => 'auth', 'Action' => 'login'

Yes controller and method

You can add custom routing rules for other settings:

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'); // will 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

The control action is under the router directory.

/Default/index

Call the defaultRouter. class. php file under the router directory.

Call the index method after obtaining the class

  • J () is the index method jump
  • R () is controlled
  • C () is the generation class
  • M () is a database model?
  • P () is the load path function.

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.