Skip to content

Commit

Permalink
Dev: changed visibility of getTemplateForFile() so it can be called f…
Browse files Browse the repository at this point in the history
…rom views
  • Loading branch information
LouisGac committed Jun 28, 2017
1 parent 78b42f8 commit ccc9875
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion application/models/TemplateConfiguration.php
Expand Up @@ -213,8 +213,23 @@ public function extendsFile($sFile)
return $this->getFilePath($sFile, $this);
}

public function getTemplateForFile($sFile, $oRTemplate)
{
while (!file_exists($oRTemplate->path.'/'.$sFile) && !file_exists($oRTemplate->viewPath.$sFile)){
$oMotherTemplate = $oRTemplate->oMotherTemplate;
if(!($oMotherTemplate instanceof TemplateConfiguration)){
return false;
break;
}
$oRTemplate = $oMotherTemplate;
}

return $oRTemplate;
}


/**
* This function will update the config file of a given template so that it extends another one
* Update the config file of a given template so that it extends another one
*
* It will:
* 1. Delete files and engine nodes
Expand Down

0 comments on commit ccc9875

Please sign in to comment.