GitHub - vogo-coder/php-router: Dynamic routing | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

vogo-coder/php-router

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Router

Latest Stable Version Total Downloads Latest Unstable Version License

Features

  • Dynamic routes
  • Pass variables in the URI
  • Mulitiple HTTP methods
  • Custom error handling
  • Enable/Disable error reporting
  • Request logging

Usage

Routes

Routes are defined in app.php

$route->get('/users', function() {
    Index::get();
});

$route->post('/user/<string:name>', function() {
    Index::post();
});

$route->delete('/user/<int:id>', function() {
    Index::delete();
});

Defining Controllers

Controllers are defined in Controllers/

class User extends BaseController
{
    public static function get()
    {
        render('index.php', array('title' => 'Index Page'));
    }

    public static function post()
    {
        json(reqVar('name'), 200);
    }

    public static function delete()
    {
        xml('Delete Request', 200);
    }
}

Installation

Via Git

git clone https://github.com/grephq/php-router.git

Via Composer

composer create-project grephq/php-router

Docs

https://github.com/grephq/php-router/wiki

Example

https://github.com/grephq/php-router/wiki/Usage#example

License

MIT License

Copyright (c) 2022 Olorunfemi-Ojo Tomiwa

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Dynamic routing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 99.1%
  • Other 0.9%

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.