Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Service 'view' was not found in the dependency injection container (error in MVC Examples!)

Hi

I downloaded MVC Examples from here: https://github.com/phalcon/mvc

when I run 'multiple-shared-layouts' and some other example projects, encountring errors.

error for 'multiple-shared-layouts' is:

Service 'view' was not found in the dependency injection container


85.3k
Accepted
answer

This means a default module is not set so it cannot find the 'view' service which is set up on every module definition.

@phalcon and how do you set the default module?



85.3k
$router->setDefaultModule("frontend");

https://github.com/phalcon/biko/blob/master/config/routes.php#L4

@phalcon and how do you set the default module?