mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 11:02:13 +00:00
Merge branch 'master' of https://github.com/skipperbent/simple-php-router
This commit is contained in:
@@ -117,7 +117,7 @@ class Router extends SimpleRouter {
|
|||||||
|
|
||||||
// Handle exceptions
|
// Handle exceptions
|
||||||
try {
|
try {
|
||||||
parent::start($defaultNamespace); // TODO: Change the autogenerated stub
|
parent::start($defaultNamespace);
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
/* @var $handler ExceptionHandler */
|
/* @var $handler ExceptionHandler */
|
||||||
foreach(self::$exceptionHandlers as $handler) {
|
foreach(self::$exceptionHandlers as $handler) {
|
||||||
@@ -136,7 +136,7 @@ class Router extends SimpleRouter {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
This is a basic example of a ```helper.php``` for generating urls.
|
This is a basic example of a helper function for generating urls.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
use Pecee\SimpleRouter\RouterBase;
|
use Pecee\SimpleRouter\RouterBase;
|
||||||
@@ -149,13 +149,13 @@ In ```routes.php``` we have added this route:
|
|||||||
|
|
||||||
```Router::get('/item/{id}', 'myController@show');```
|
```Router::get('/item/{id}', 'myController@show');```
|
||||||
|
|
||||||
In the template we call:
|
In the template we then call:
|
||||||
|
|
||||||
```url('myController@show', ['id' => 22], ['category' => 'shoes']);```
|
```url('myController@show', ['id' => 22], ['category' => 'shoes']);```
|
||||||
|
|
||||||
Result url is:
|
Result url is:
|
||||||
|
|
||||||
```/item/22?category=shoes```
|
```/item/22?category=shoes ```
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
While I work on a better documentation, please refer to the Laravel 5 routing documentation here:
|
While I work on a better documentation, please refer to the Laravel 5 routing documentation here:
|
||||||
|
|||||||
Reference in New Issue
Block a user