Hi! I have module Game:
And two Controllers - IndexController.php, PlayController.php
Routing:
$router->add('/:module', array(
'module' => 1,
'controller' => 'index',
'action' => 'index',
));
$router->add('/:module/:action', array(
'module' => 1,
'controller' => 'index',
'action' => 2,
));
$router->add('/play/:params', array(
'module' => 'game',
'controller' => 'play',
'action' => 'index',
'params' => 1
));
```php
**Module.php**
```php
$di->set('view', function() {
$view = new \Phalcon\Mvc\View();
$view->setViewsDir(__DIR__ . '/views/');
$view->setLayoutsDir('../../../templates/');
$view->setPartialsDir('../../../templates/partials/');
return $view;
});
```php
--1-- /templates/index.phtml - the main view.
I open link:
www.site.loc/game/ - OK, all views rendered. [Module - Game, Controller - Index, Action - Index]
www.site.loc/play/1 - Show View only /views/play/index.phtml, but without main view --1--. [Module - Game, Controller - Play, Action - Index]
But if move /templates/index.phtml to /modules/game/views/index.phtml - OK
Why? How correct it?