Skip to content

Instantly share code, notes, and snippets.

@RafaelKa
Created April 1, 2014 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RafaelKa/9913227 to your computer and use it in GitHub Desktop.
Save RafaelKa/9913227 to your computer and use it in GitHub Desktop.
econics subfolders for actioncontroller
##
# subfolder, controller and action with optional format
-
name: 'subfolder, controller and action with optional format'
uriPattern: '{@cf}/{@cn}/{@action}(.{@format})'
defaults:
'@package': 'Foo.Bar'
'@controller': '{@cf}\{@cn}'
'@format': 'html'
##
# subfolder, controller and action with optional format
-
name: 'subfolder, controller and action with optional format'
uriPattern: '{@controller}/{@action}(.{@format})'
defaults:
'@package': 'Foo.Bar'
'@controller': 'YourStandardSubFolder\Standard'
'@format': 'html'
routeParts:
'@controller':
handler: 'Econic\Package\Mvc\Routing\SubFolderPartHandler'
<php
//...
/**
* ...
*/
protected function findValueToMatch($routePath) {
$valueToMatch = $routePath; // is whole uri
// find string before and after slash f.x. "subfolder/controller"
return "subfolder/controller";
}
//...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment