Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Oct 23, 2015
1 parent 6d49fa3 commit be67c14
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ RedirectHandlerModule
[![Coverage Status](https://coveralls.io/repos/samsonasik/RedirectHandlerModule/badge.svg?branch=master)](https://coveralls.io/r/samsonasik/RedirectHandlerModule)
[![Downloads](https://img.shields.io/packagist/dt/samsonasik/redirect-handler-module.svg?style=flat-square)](https://packagist.org/packages/samsonasik/redirect-handler-module)

*RedirectHandlerModule* is a module for handling redirect when the given url to redirect plugin is not registered in your zf2 application. It simply override existing ZF2 redirect plugin, so you can just use it.
*RedirectHandlerModule* is a module for handling redirect when the given url to redirect plugin is not registered in your zf2 application. It simply override existing ZF2 redirect plugin, so we can just use it.

For example, you use `redirect()` plugin in your controller:
For example, we use `redirect()` plugin in your controller:

```php
$redirect = $this->params()->fromQuery('redirect', '');

$redirect = '/foo'; // may be a variable from GET
return $this->redirect()->toUrl($redirect);
```

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` registerd in `config/redirect-handler-module.local.php`:
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/redirect-handler-module.local.php`:

For example, you define:
For example, we define:

```php
return array(
Expand All @@ -38,9 +37,7 @@ Installation
$ composer require samsonasik/redirect-handler-module:dev-master
```

- Copy Config

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.
- 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.

- register to `config/application.config.php`:

Expand Down

0 comments on commit be67c14

Please sign in to comment.