Currently I am loading all users on URL/Route /admin/config/users
which is picking this view ( private/apps/Admin/Views/user/users.volt
) from Admin
module.
Now I have set a flag for custom layout. So if custom layout is enabled I want the phalcon to pick view from AdminExtension
module i.e ( private/apps/Admin/Extension/Views/user/users.volt
)
How can I achive this? I want both views. Because private/apps/Admin/Views/user/users.volt
is default view for listing all users. However private/apps/Admin/Extension/Views/user/users.volt
is customised view for client where a lot of design changes are done.
Dispatcher code:
/**
* @param Dispatcher $dispatcher
*/
public function afterExecuteRoute(Dispatcher $dispatcher) {
// Check if Json response is required
if ($this->_isJsonResponse) {
} else {
if(CxSettingCustomLayout::loadFromDb()->isCustomLayout()) {
//pick custom view here" `private/apps/Admin/Extension/Views/user/users.volt`
}
// Build current module configuration settings section name
$moduleConfigName = 'app_' . $this->dispatcher->getModuleName();
// Include assets configuration file where assets collections are defined
if(file_exists($this->config[ $moduleConfigName ]['assetsFile']))
include $this->config[ $moduleConfigName ]['assetsFile'];
// Set a view variable with the current language code
$this->view->setVar('current_language_code', $this->CxTranslation->getLanguage()->getCode());
}
}