Skip to content

Instantly share code, notes, and snippets.

@geggleto
Created December 10, 2015 18:30
Show Gist options
  • Select an option

  • Save geggleto/1e52dfd646b5a2c9a8e3 to your computer and use it in GitHub Desktop.

Select an option

Save geggleto/1e52dfd646b5a2c9a8e3 to your computer and use it in GitHub Desktop.
## Use case
I have several "components" which are standalone Slim applications.
Maybe its a "UserManagement"... while I can run this module at /users on it's own... I want to install this package on another larger project.
In my main app,
I load "components"...
$components = [
"UserManagement" => [
"routes" => "../usermanagement/routes.php",
"prefix" => "/module"
]
];
foreach ($components as $component) {
$app->group($component['prefix'], function () {
include $component['routes'];
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment