Make form folder optional

When the form folder didn't exist, an exception was thrown that
froze the frontend without any error message. Now it is tested
whether the form folder in a module is available and only registered
in the auotoloader if so.

refs #4407
This commit is contained in:
Jannis Moßhammer 2013-07-15 13:37:43 +02:00
parent 5489c2fa2e
commit e83526be08
1 changed files with 3 additions and 2 deletions

View File

@ -227,9 +227,10 @@ class Module
$moduleLibraryDir = $this->getLibDir(). '/'. $moduleName;
$this->app->getLoader()->registerNamespace($moduleName, $moduleLibraryDir);
if (is_dir($this->getFormDir())) {
$this->app->getLoader()->registerNamespace($moduleName. '\\Form', $this->getFormDir());
}
}
return $this;
}