2017 © Pedro Peláez
 

library yar

Yet Another Router for PHP. Simple, Stupid and totally framework independent.

image

victorium/yar

Yet Another Router for PHP. Simple, Stupid and totally framework independent.

  • Monday, February 12, 2018
  • by jjmutumi
  • Repository
  • 0 Watchers
  • 0 Stars
  • 3 Installations
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Yet Another Router (YAR) for PHP

Introduction

YAR is a very simple routing library for PHP that routes URLs to methods in classes., (*1)

Licence

All source files in YAR are released subject to the terms of the MIT license, as written in the included LICENSE.txt file., (*2)

Installation

Composer

YAR can be installed with composer (http://getcomposer.org/)., (*3)

  1. Install composer:, (*4)

    $ curl -s https://getcomposer.org/installer | php
    
  2. Require YAR as a dependency using composer:, (*5)

    $ php composer.phar require victorium/yar
    

Getting Started

This is a simple example on getting started with YAR:, (*6)

<?php

define("PATH_TO_YAR_SRC", dirname(__DIR__));

require PATH_TO_YAR_SRC . "/bootstrap.php";

use Yar\Http\Exception\Exception404;
use Yar\Http\Request;
use Yar\Router;

class Home {
    public function index() {
        echo "Hi from index";
    }

    public function sum($a, $b) {
        return $a + $b;
    }
}

$config = [
    "route" => [
        "max_parts" => 1000,
        "namespaces" => [""],
    ]
];

$request = Request::fromGlobals($config);

$override = ["" => "home/index"];
list($obj, $methodName, $args) = Router::createCallable($request, $override);
call_user_func([$obj, $methodName], $args);

The Versions

12/02 2018

dev-master

9999999-dev https://bitbucket.org/victorium/yar

Yet Another Router for PHP. Simple, Stupid and totally framework independent.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

router another yet

02/09 2016

1.0.2

1.0.2.0

Yet Another Router for PHP. Simple, Stupid and totally framework independent.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

router another yet

15/08 2016

1.0.1

1.0.1.0

Yet Another URL Router for PHP. Simple, Stupid and totally framework independent implemented as c extensions.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

url extension router zephir another c yet c extension

15/08 2016

1.0.0

1.0.0.0

Yet Another URL Router for PHP. Simple, Stupid and totally framework independent implemented as c extensions.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

url extension router zephir another c yet c extension