Download the PHP package samsonasik/redirect-handler-module without Composer
On this page you can find all versions of the php package samsonasik/redirect-handler-module. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download samsonasik/redirect-handler-module
More information about samsonasik/redirect-handler-module
Files in samsonasik/redirect-handler-module
Package redirect-handler-module
Short Description Laminas module to for Url Redirect handling
License MIT
Homepage https://github.com/samsonasik/RedirectHandlerModule
Informations about the package redirect-handler-module
RedirectHandlerModule
RedirectHandlerModule is a module for handling redirect when the given url to redirect plugin is not registered in your Laminas application. It simply override existing Laminas redirect plugin, so we can just use it.
This is README for version ^3.0 which only support Laminas 3 with php ^7.1.
For version 2, you can read at version 2 readme which still support ZF3 with php ^7.1 support.
For version 1, you can read at version 1 readme which still support ZF2 with php ^5.6|^7.0 support.
For example, we use redirect()
plugin in your controller:
if the passed $redirect
as url is a valid and registered in the routes, it uses default redirect()
implementation, otherwise, it will redirect to default default_url
registered in config/autoload/redirect-handler-module.local.php
:
For example, we define:
It means, we can't allow to make redirect to outside registered routes, whenever found un-registered url in routes, then we will be redirected to default_url. It also disable redirect to self, so you can't redirect to self.
For specific urls that exceptional ( allowed to be redirected even not registered in routes), you can register at exclude_urls
/exclude_hosts
options.
if you define exclude_urls/exclude_hosts options, which one of them is your own current url/host/domain, its your risk to still get "infinite" redirection loops. so, make sure exclude_urls/exclude_hosts is not your current own.
While default implementation of redirect to self will silently, you can trigger your listener to handle redirect to self in your Module::onBootstrap($e)
:
Installation
Require via composer
After composer require done, you can copy vendor/samsonasik/redirect-handler-module/config/redirect-handler-module.local.php.dist
to config/autoload/redirect-handler-module.local.php
and modify on your needs.
Last, register to config/application.config.php
:
Contributing
Contributions are very welcome. Please read CONTRIBUTING.md
Credit
All versions of redirect-handler-module with dependencies
laminas/laminas-mvc Version ^3.0
laminas/laminas-servicemanager Version ^3.3.0