S
S
semki0962017-04-13 15:47:20
PHP
semki096, 2017-04-13 15:47:20

How to build a classic application skeleton in Slim PHP?

I study Slim docks. Router:

$app->get('/[{name}]', function ($request, $response, $args) {
    return $this->renderer->render($response, 'index.phtml', $args);
});

All routes are in our routes.php file (which in turn is connected to the entry point). As far as I understand, the function in the route plays the role of a controller? In theory, I can make a separate folder with controllers, because keeping everything in one file is not very good, since the functions will be large. How to do it right in Slim?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Gaiduk, 2017-10-01
@Danan

https://github.com/akrabat/slim3-skeleton
Like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question