Skip to content

Pass captured regex values to route handler defined as functions.#86

Open
jbottigliero wants to merge 1 commit intoanandkunal:masterfrom
jbottigliero:master
Open

Pass captured regex values to route handler defined as functions.#86
jbottigliero wants to merge 1 commit intoanandkunal:masterfrom
jbottigliero:master

Conversation

@jbottigliero
Copy link
Copy Markdown

This update allows $regex_matches to be passed to handler methods the same way they are called when using a class handler.

For example:

'/route/([page1/page2/page3])+)' => function ($page) {
 switch($page) {
  case 'page1':
  break;
  case 'page2':
  break;
 }
},
'/another/:number' => function ($number) { ... }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant