simple-php-router

Simple, fast and yet powerful PHP router that is easy to get integrated and in any project. Heavily inspired by the way Laravel handles routing, with both simplicity and expand-ability in mind.

Downloads
140.9K
Stars
646
Committers
13
simple-php-router - Version 1.2.6.2

Published by skipperbent about 9 years ago

  • Fixed missing "/" in the getRoute method on some rare occasions.
simple-php-router - Version 1.2.6.1

Published by skipperbent about 9 years ago

Note: Re-released as version 1.2.6.1 as the last version didn't contain the fix

  • If no parameters are specified/defined in the route, the getRoute method will now per default add the parameters array if provided instead.
simple-php-router - Version 1.2.5

Published by skipperbent about 9 years ago

  • Fixed getRoute method in SimpleRouter not being static.
simple-php-router - Version 1.2.4

Published by skipperbent about 9 years ago

  • Added getUserAgent and getReferer methods to Request class.
  • Added ip method to Response class.
  • Added getInput method to return request items in Response class.
  • Added more features to Response class.
simple-php-router - Version 1.2.3

Published by skipperbent about 9 years ago

  • Fixed csrf-token cookie not being set on some paths.
  • Changed RouterException in BaseCsrfVerifier to TokenMismatchException.
  • Updated documentation.
simple-php-router - Version 1.2.2

Published by skipperbent about 9 years ago

Breaking changes

Removed request-type prefix when loading methods.
Methods within the controller no longer has to be prefixed with the current request method.

For example when posting to a method - the name of the method no longer has to be named postSomething().

Changes

  • Added support for custom CSRF middlewares.
  • Added more logic to CsrfToken class.
  • Added header support to Request class.
  • Added option to set BaseCsrfVerifier class in RouterBase and SimpleRouter.
  • Removed request-type prefix when loading methods.
  • Updated documentation.
  • Fixed missing / in beginning of url in getRoute when route does not exist.
simple-php-router - Version 1.2.1

Published by skipperbent about 9 years ago

Breaking changes

Removed request-type prefix when loading methods.
Methods within the controller no longer has to be prefixed with the current request method.

For example when posting to a method - the name of the method no longer has to be named postSomething().

Changes

  • Added support for custom CSRF middlewares.
  • Added more logic to CsrfToken class.
  • Added header support to Request class.
  • Added option to set BaseCsrfVerifier class in RouterBase and SimpleRouter.
  • Removed request-type prefix when loading methods.
  • Updated documentation.
simple-php-router - Version 1.2

Published by skipperbent about 9 years ago

Breaking changes

Removed request-type prefix when loading methods.
Methods within the controller no longer has to be prefixed with the current request method.

For example when posting to a method - the name of the method no longer has to be named postSomething().

Changes

  • Added more logic to CsrfToken class.
  • Added header support to Request class.
  • Added option to set BaseCsrfVerifier class in RouterBase and SimpleRouter.
  • Removed request-type prefix when loading methods.
  • Updated documentation.
simple-php-router - Version 1.1.2

Published by skipperbent about 9 years ago

Breaking changes

  • RouterRessources has been renamed to RouterResource.
  • SimpleRouter::ressource has been renamed to SimpleRouter::resource.

Changelog

  • Fixed middleware not loading and giving "class must be instance of Middleware" exception.
  • Added basic auth to Response class.
  • Added getPassword() method for basic auth password in Response class.
  • Fixed router not throwing RouterException with "Method not allowed" when using a unsupported request method.
  • Method request type are now checked on all classes in the RouterBase class.
  • Added support for alias on RouterRoute.
  • Added typo in resource (renamed class from Ressource to Resource).
  • Added optional settings parameter in most of the methods in the SimpleRouter class.
  • Urls now always returns ending slash when using getRoute() method.
  • Fixed common errors with routing.
  • Simplified getRoute method.
  • Updated documentation.
simple-php-router - Version 1.1.1

Published by skipperbent about 9 years ago

Breaking changes

  • RouterRessources has been renamed to RouterResource.
  • SimpleRouter::ressource has been renamed to SimpleRouter::resource.

Changelog

  • Added basic auth to Response class.
  • Added getPassword() method for basic auth password in Response class.
  • Fixed router not throwing RouterException with "Method not allowed" when using a unsupported request method.
  • Method request type are now checked on all classes in the RouterBase class.
  • Added support for alias on RouterRoute.
  • Added typo in resource (renamed class from Ressource to Resource).
  • Added optional settings parameter in most of the methods in the SimpleRouter class.
  • Urls now always returns ending slash when using getRoute() method.
  • Fixed common errors with routing.
  • Simplified getRoute method.
  • Updated documentation.
simple-php-router - Version 1.1

Published by skipperbent about 9 years ago

Breaking changes

  • RouterRessources has been renamed to RouterResource.
  • SimpleRouter::ressource has been renamed to SimpleRouter::resource.

Changelog

  • Fixed router not throwing RouterException with "Method not allowed" when using a unsupported request method.
  • Method request type are now checked on all classes in the RouterBase class.
  • Added support for alias on RouterRoute.
  • Added typo in resource (renamed class from Ressource to Resource).
  • Added optional settings parameter in most of the methods in the SimpleRouter class.
  • Urls now always returns ending slash when using getRoute() method.
  • Fixed common errors with routing.
  • Simplified getRoute method.
  • Updated documentation.
simple-php-router - Version 1.0.3.1

Published by skipperbent about 9 years ago

  • Added new match method to RouterEntry to match specific regular expression on url.
  • GetRoute now returns provided controller and method if no match is found.
  • Cleaned up the code a bit.
  • Bugfixes and other minor improvements.
simple-php-router - Version 1.0.3

Published by skipperbent about 9 years ago

  • Fixed issues with getRoute method.
  • Added new Response and Request classes.
  • Added CSRF stuff.
  • Cleanup and bugfixes.
simple-php-router - Version 1.0.2.1

Published by skipperbent about 9 years ago

  • Fixed router for controller and ressources not matching /something?.
  • Added where method in RouterEntry class to support custom regular expression matches on parameters.
  • Moved parameters property to RouterRoute class.
  • Added IRouteEntry class.
simple-php-router - Version 1.0.2

Published by skipperbent about 9 years ago

  • Fixed router for controller and ressources not matching /something?.
  • Added where method in RouterRoute class to support custom regular expression matches on parameters.
  • Moved parameters property to RouterRoute class.
  • Added IRouteEntry class.
simple-php-router - Version 1.0.1

Published by skipperbent about 9 years ago

  • Made sure that urls are always presented in the correct order.
  • Ignored RouterGroup in when looping through controllers in controllerUrlMap.