Skip to content

Commit

Permalink
add Redirect.md
Browse files Browse the repository at this point in the history
  • Loading branch information
easy-system committed Jun 14, 2016
1 parent 51658f2 commit 96a6051
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docs/003.Redirect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Redirect
========

The plugin allows redirect to specified route or url. It returns the instance
of `Psr\Http\Message\ResponseInterface`:
```
use Es\ControllerPlugins\PluginsTrait;
class ExampleController
{
use PluginsTrait;
public function indexAction()
{
// ...
return $this->redirect()->toUrl('http://google.com');
}
}
```
```
use Es\ControllerPlugins\PluginsTrait;
class ExampleController
{
use PluginsTrait;
public function indexAction()
{
// ...
return $this->redirect()->toRoute('foo', ['bar' => 'baz']);
}
}
```

0 comments on commit 96a6051

Please sign in to comment.