GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - appzcoder/routing: URL Request Router

BranchesTags
Open more actions menu

Latest commit

 

History

23 Commits
23 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

URL Request Router

URL Request Router

Installation

  1. Run

    composer require appzcoder/routing:"dev-master"
    
  2. Add bellow lines to your script

    require 'vendor/autoload.php';

Usage

// Make Route alias of Route Facade for static instance calling
class_alias('Appzcoder\Routing\RouterFacade', 'Route');

// Set your own controller namespace (optional)
Route::setControllerNamespace("App\\Controllers\\");

// GET Route with anonymous function
Route::get('/', function () {
    return 'Hello World';
});

// Route with name parameter
Route::get('/demo/hello/{name}', 'MyController#getHello');

// Route with name and id both parameters
Route::get('/demo/hello/{id}/me/{name}', 'MyController#getHello');

// POST Verb Route
Route::post('/demo', 'MyController#getIndex');

// Controller Route
Route::controller('/my', 'MyController');

// RESTfull Resource Route
Route::resource('/person', 'PersonController');

// Group Route
Route::group(['prefix' => 'admin', 'namespace' => 'Admin'], function () {
    Route::get('/users', function () {
        return "/admin/users";
    });

    Route::get('/teachers', function () {
        return "/admin/teachers";
    });

    Route::get('/dashboard', 'AdminController#getIndex');
});

// Finally execute or dispatch your route to your desire cotroller method or callback
Route::execute();

##Author

Sohel Amin

About

URL Request Router

packagist.org/packages/appzcoder/routing

Resources

Readme
Activity
Custom properties

Stars

4 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.