Bug fix for extending views
Closed this issue · 6 comments
waterproofy commented
file: Da\User\Bootstrap.php
line 292:
protected function initControllerNamespace(WebApplication $app)
{
$app->getModule('user')->controllerNamespace = $app->getModule('user')->controllerNamespace;
$app->getModule('user')->setViewPath('@Da/User/resources/views');
}
change to:
protected function initControllerNamespace(WebApplication $app)
{
$app->getModule('user')->controllerNamespace = $app->getModule('user')->controllerNamespace;
if (!empty($app->getModule('user')->viewPath)){
$app->getModule('user')->setViewPath($app->getModule('user')->viewPath);
}else{
$app->getModule('user')->setViewPath('@Da/User/resources/views');
}
}
maxxer commented
Is the if
really required? The viewPath
property is correctly initialized in the module, should work with just the first command, isn't it?
waterproofy commented
If you think it is not necessary, you can remove it.
maxxer commented
I was wondering if you added it on purpose or for precaution. It shouldn't be necessary so I was asking if you tested it
waterproofy commented
I haven't test it.
I think it's better to prevent someone leaving empty.
waterproofy commented
Test it already.
protected function initControllerNamespace(WebApplication $app)
{
$app->getModule('user')->controllerNamespace = $app->getModule('user')->controllerNamespace;
$app->getModule('user')->setViewPath($app->getModule('user')->viewPath);
}
maxxer commented
If you don't mind creating a PR I'll merge right away. Thanks