2017 © Pedro Peláez
 

library anrouter

A simple and small routing library

image

anujsinghwd/anrouter

A simple and small routing library

  • Thursday, March 29, 2018
  • by anujsinghwd
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

anrouter

A simple and small PHP Routing, (*1)

Installation

  • composer require anujsinghwd/anrouter

Usage

  • First configure .htaccess jsx RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . index.php [L]
  • $anrouter = new AnRouter(), (*2)

  • Simply make function according to your route, (*3)

Example

  • index.php File, (*4)

    require_once './lib/AnRouter.php';
    
    $anrouter = new AnRouter();
    
    $anrouter->get('method_name'); -> For GET REQUEST
    $anrouter->post('method_name'); -> For POST REQUEST
    $anrouter->put('method_name'); -> For PUT REQUEST
    $anrouter->delete('method_name'); -> For DELETE REQUEST
    
    function method_name()
    {
        echo "Method Called";
    }
    
  • Above route called by (http://your_base_url/method_name)

Parameter Handling

  • Pass with request jsx $anrouter->get('method_name', array('agr1' => $val))
  • Getting the Parameter in function jsx function method_name($param) { echo $param; }

The Versions

29/03 2018

dev-master

9999999-dev https://github.com/anujsinghwd/anrouter

A simple and small routing library

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

routing method routing