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.
Published by skipperbent over 1 year ago
Published by skipperbent over 1 year ago
Published by skipperbent over 1 year ago
Published by skipperbent over 3 years ago
Published by skipperbent over 3 years ago
Published by skipperbent over 3 years ago
mergeExceptionHandlers
to prevent router from merging inherited exception-handlers (issue: #573).RouteGroup
: Added setMergeExceptionHandlers
and getMergeExceptionHandlers
methods.IRouteGroup
: Added setMergeExceptionHandlers
and getMergeExceptionHandlers
method.Published by skipperbent over 3 years ago
Published by skipperbent over 3 years ago
DebugHandler::fireEvent
not providing correct arguments when calling fireEvents
.setMatch
not setting parsed parameters correctly (issue: #566).Published by skipperbent over 3 years ago
Published by skipperbent over 3 years ago
InputHandler::exists
to check array of indexes exists.Published by skipperbent over 3 years ago
InputItem
class.Router::addExceptionHandler
method.Url
class.Request::getHeader
.Published by skipperbent over 3 years ago
SimpleRouter::error
helper not to work when used within a group.SimpleRouter::error
.Published by skipperbent over 3 years ago
InputItem
can now be used like array (for example: input()->post('items')[0]
) if value is array.get
, post
and file
methods to allow for mixed object as return-type (input()->post('form', new InputItem('post'))
.InputItem->__toString()
to correctly parse null
default-value.call_user_func_array
for PHP 8 compatibility in unit-tests.Published by skipperbent over 3 years ago
Service
will append to any existing namespace whereas \Service
will overwrite it.InputFile::getError
to correct nullable int.all
, match
, controller
and resource
in SimpleRouter
class.parse_str
function in Url::setQueryString
method.array_flip
function in Url::removeParams
method.Published by skipperbent over 3 years ago
Published by skipperbent over 3 years ago
?string
return type from IResourceController
as the return type can be mixed.Published by skipperbent over 3 years ago
includeParams
parameter to Url::getRelativeUrl
and Url::getAbsoluteUrl
methods.BaseCsrfVerifier
matching urls against urls with parameters.Published by skipperbent over 3 years ago
include
property to BaseCsrfVerifier
for routes that should be allowed when used in conjunction with the exclude
property and url-ranges (like /admin/*
).https
scheme support to Request::setUri
(used when calling $request->getUrl()->getAbsoluteUrl()
.isSubRoute
event parameter for EVENT_ADD_ROUTE
.IGroupRoute::prependPrefix
.BaseCsrfVerifier
unit-tests.Published by skipperbent over 3 years ago
IClassLoader
to load class methods. If you use a custom class-loader, make sure that you implement the new loadClassMethod
from the IClassLoader
interface.IClassLoader
.call_user_func_array
in ClassLoader
.InputHandler::find
and InputHandler::value
failing when using array
in methods parameter.InputHandler::find
tests.Published by skipperbent over 3 years ago
THIS UPDATE CONTAINS BREAKING CHANGES!
PLEASE READ THE NOTES CAREFULLY BEFORE UPDATING ANY LIVE ENVIRONMENT.
php-di no longer integrated by default
php-di integration is still possible, however a custom class-loader is now used to create integrations with frameworks of choice. See the "Class Loader" section in the documentation for more information and examples on how to migrate your existing php-di integration.
Return type for input()
helper
The input
helper function and associated method InputHandler::value
has been fixed to return the raw value as originally intended. As a result IInputItem
is no longer returned when calling input('name')
. All references to input('my-input')->getValue()
should therefore be changed to input('my-input')
. The IInputItem
object can still be accessed by using input()->find('my-input')
instead.
Request::getIp()
and added new optional $safeMode
parameter.Request::getContentType
for content-type header-parsing.InputHandler
.InputItem
.Router::setRenderMultipleRoutes($bool)
).SimpleRouter::enableMultiRouteRendering($bool)
.filterEmptyParams
option on IRoute
classes.Request::getFirstHeader
method that returns the first header found from array list- used to simplify the code.InputHandler::getValueFromArray
method that loops through input-items to ensure that value is always returned when calling the InputHandler->value()
method.ClassNotFoundHttpException
thrown when class is not found.$_FILE
support for Request::all
method.[\w\-]+
(supports dashes) to avoid any confusion.input()->all()
will now always return keys defined. If the key doesn't exists the value will be set to null
.Request::isPostBack
helper method that returns true if request-method is of type that could contain data in body.\
they will always overwrite the default-namespace.Router::setDefaultNamespace()
no longer has to be set in the beginning of routes.php
.partialGroups
.findRoute
not working in BootManager
.Closure
, array
given' error when $closure
is a object method.SimpleRouter::getUrl
with array as parameters option would throw an error.SimpleRouter::getUrl
having wrong nullable return type.getIp
method when server is using the x-forwarded-for
header.InputHandler
not to get the correct request-method.Request
class.ClassNotFoundHttpException
is now thrown when class/method is not found (backwards compatible).php-di
from composer + code.tryParse
argument to the Request->getHeader
method. When enabled the method will try to parse headers from both server and client-side (enabled by default).getIp
method of the Request
-class.InputHandler
to better support for nested values.\is_callable($callback) === false
as the execution costs less than previous in Router.php
.ob_get_contents
to ob_get_clean
.Route
class to global Request
-class and changed references.InputHandler
class so it only parses inputs once when calling all
-method.csrf-token
post-value are now available for all Request::$requestTypePost
request-methods.$values
to $settings
in Route::setSettings
and related methods.-
in reg-ex as it's only required when next to character-class..idea
folder.findUrl
.TestRouter
so host-name is always set when using php-unit.input()->all()
method.ClassLoader
php-unit tests.InputHandler
.Request::getContentType
parsing.Request::getIp
.