Simple virtual page framework library for PHP
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Simple PHP Virtual page handler library

This is a simple page handler for PHP for creating virtual pages. I use a similar library in numerous sites and projects, and rather than keep cutting and pasting, I figured it deserved its own library.


    // Register a page
    \simple_page_handler\Page::create('my/page/', function($page, array $subpages) {

        // Your page handling code



    // And in your example page handler endpoint
    try {
        if (!\simple_page_handler\Page::call(\simple_page_handler\Input::get('page'))) {
            echo "Something went wrong.";
    } catch (Exception $e) {
        echo $e->getMessage();

Once you've created your endpoint handler you should use .htaccess to redirect any unhandled requests to your endpoint. See example_htaccess_dist.


  • Mod_rewrite