Skip to content

How can I separate and group the routes into files and folders? #6

@lautiamkok

Description

@lautiamkok

I wonder how can we organise the simple routes below when they get bigger when the app grows.

// Configure your routes
$app->set('routes', function (RouteCollector $r) {
    $r->map('/', null, function () {
        return new Response('Hello, world');
    });

    $r->map('/hello/{name}', null, function ($name) {
        return new Response('Hello, ' . $name . '!');
    });
});

For instance, with Slim framework, I can do this when we have routes to be grouped and stored in different files,

$app = new Slim();
require '../app/routes/session.php';
require '../app/routes/member.php';
require '../app/routes/admin.php';
$app->run();

url: http://www.slimframework.com/2011/09/24/how-to-organize-a-large-slim-framework-application.html

Can this be done with Nice?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions