PHP Framework queryphp Course: Getting Started eight by jump

Source: Internet
Author: User
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
  • 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.