2017 © Pedro Peláez
 

library router

PHP Router

image

wattanar/router

PHP Router

  • Wednesday, June 6, 2018
  • by wattanar
  • Repository
  • 1 Watchers
  • 0 Stars
  • 85 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 16 Versions
  • 5 % Grown

The README.md

Install with composer

{
    "require" : {
        "wattanar/router" : "dev-master"
    },
    "autoload": {
        "psr-4": {
            "App\\" : "app/"
        }
    }
}

Usage

<?php

namespace App\Controllers;

class HomeController
{
    public function index()
    {
        echo 'Hello World!';
    }
}
<?php

require_once 'vendor/autoload.php';

$app = new \Wattanar\Router;

$app->get('/', 'App\Controllers\HomeController::index');

$app->run();

Web Server Configuration

Apache

Options All -Indexes
Options +FollowSymLinks

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

Nginx

server {
    listen       3100;
    server_name  localhost;

    root   html/myweb;
    index  index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~* \.(js|jpg|png|css)$ {
        expires off;
    }

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass   127.0.0.1:9123;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}

The Versions

06/06 2018

dev-master

9999999-dev https://github.com/wattanar/router

PHP Router

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

php router

14/07 2016

3.0

3.0.0.0 https://github.com/wattanar/router

PHP Router

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

php router

26/05 2016

2.6

2.6.0.0 https://github.com/wattanar/gnix

Gnix Router

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

php router

03/05 2016

2.5

2.5.0.0 https://github.com/wattanar/gnix

Gnix Router

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

php router

28/04 2016

2.4

2.4.0.0 https://github.com/wattanar/ginx

Gnix Router

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

php router

26/04 2016

2.3

2.3.0.0 https://github.com/wattanar/ginx

Gnix Router

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

php router

26/04 2016

2.2

2.2.0.0 https://github.com/wattanar/ginx

Gnix Router

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

php router

26/04 2016

2.1

2.1.0.0 https://github.com/wattanar/ginx

Gnix Router

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

php router

23/04 2016

2.0

2.0.0.0 https://github.com/wattanar/ginx

Gnix Framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

framework php

23/04 2016

1.7

1.7.0.0 https://github.com/wattanar/ginx

Gnix Framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

framework php

22/04 2016

1.6

1.6.0.0 https://github.com/wattanar/ginx

Gnix Framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

framework php

21/04 2016

1.5

1.5.0.0 https://github.com/wattanar/ginx

Gnix Framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

framework php

21/04 2016

1.4

1.4.0.0 https://github.com/wattanar/ginx

Gnix Framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

framework php

21/04 2016

1.2

1.2.0.0 https://github.com/wattanar/ginx

Gnix Framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

framework php

21/04 2016

1.1

1.1.0.0 https://github.com/wattanar/ginx

Gnix Framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

framework php

21/04 2016

1.0

1.0.0.0 https://github.com/wattanar/ginx

Gnix Framework

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

framework php