Skip to content

Commit

Permalink
Added namespace example
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjgreen committed Dec 27, 2015
1 parent dbe2b98 commit 5915619
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ $router->group(['prefix' => 'admin'], function($router){
###Controllers

```php
namespace MyApp;

class Test {

public function anyIndex()
Expand Down Expand Up @@ -261,10 +263,10 @@ class Test {
}
}

$router->controller('/controller', 'Test');
$router->controller('/controller', 'MyApp\\Test');

// Controller with associated filter
$router->controller('/controller', 'Test', ['before' => 'auth']);
$router->controller('/controller', 'MyApp\\Test', ['before' => 'auth']);
```


Expand Down

0 comments on commit 5915619

Please sign in to comment.