* Private loader for all template types
*
* @param $template The template we shall load
+ * @param $extOther An other extension to use
* @return void
* @throws FileNotFoundException If the template was not found
*/
- protected function loadTemplate ($template, $ext = '') {
+ protected function loadTemplate ($template, $extOther = '') {
// Get extension for the template if empty
- if (empty($ext)) {
+ if (empty($extOther)) {
// None provided, so get the raw one
$ext = $this->getRawTemplateExtension();
- } // END - if
+ } else {
+ // Then use it!
+ $ext = (string) $extOther;
+ }
// Construct the FQFN for the template by honoring the current language
$fqfn = sprintf("%s%s%s%s/%s/%s%s",
$this->loadRawTemplateData($fqfn);
} catch (FileNotFoundException $e) {
// If we shall load a code-template we need to switch the file extension
- if ($this->getTemplateType() != $this->getConfigInstance()->readConfig('web_template_type')) {
+ if (($this->getTemplateType() != $this->getConfigInstance()->readConfig('web_template_type')) && (empty($extOther))) {
// Switch over to the code-template extension and try it again
$ext = $this->getCodeTemplateExtension();