Skip to content

Commit

Permalink
Add before and after calls to our routes
Browse files Browse the repository at this point in the history
This will make the `maintenance_mode` check work, and some other
features
  • Loading branch information
xiaohutai committed Jan 2, 2018
1 parent be7249f commit f731ebf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Controller/HierarchicalRoutesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ public function connect(Application $app)
$ctr
->match("/{slug}", [$this, 'recordExactMatch'])
->assert('slug', $requirement->anyRecordRouteConstraint())
->before('controller.frontend:before')
->after('controller.frontend:after')
->bind('hierarchicalroutes.record.exact')
;

$ctr
->match("/{slug}", [$this, 'listingExactMatch'])
->assert('slug', $requirement->anyListingRouteConstraint())
->before('controller.frontend:before')
->after('controller.frontend:after')
->bind('hierarchicalroutes.listing.exact')
;

Expand All @@ -51,6 +55,8 @@ public function connect(Application $app)
->match("/{parents}/{slug}", [$this, 'recordPotentialMatch'])
->assert('parents', $requirement->anyPotentialParentConstraint())
->assert('slug', '[a-zA-Z0-9_\-]+') // this may result in a 404
->before('controller.frontend:before')
->after('controller.frontend:after')
->bind('hierarchicalroutes.record')
;

Expand Down

0 comments on commit f731ebf

Please sign in to comment.