mirror of
https://github.com/Mibew/handlebars.php.git
synced 2025-05-04 11:03:08 +03:00
Setting a prefix on partial now works with sub directories
This commit is contained in:
parent
1c90b6a169
commit
09c0442132
@ -114,12 +114,15 @@ class Handlebars_Loader_FilesystemLoader implements Handlebars_Loader
|
||||
protected function getFileName($name)
|
||||
{
|
||||
$fileName = $this->_baseDir . '/';
|
||||
$fileParts = explode('/', $name);
|
||||
$file = array_pop($fileParts);
|
||||
|
||||
if (substr($name, strlen($this->_prefix)) !== $this->_prefix){
|
||||
$fileName .= $this->_prefix;
|
||||
if (substr($file, strlen($this->_prefix)) !== $this->_prefix){
|
||||
$file = $this->_prefix . $file;
|
||||
}
|
||||
|
||||
$fileName .= $name;
|
||||
$fileParts[] = $file;
|
||||
$fileName .= implode('/', $fileParts);
|
||||
|
||||
if (substr($fileName, 0 - strlen($this->_extension)) !== $this->_extension) {
|
||||
$fileName .= $this->_extension;
|
||||
|
Loading…
Reference in New Issue
Block a user