mirror of
https://github.com/openvk/chandler.git
synced 2024-11-15 03:31:12 +03:00
Add ability to change template search path
Signed-off-by: Celestora <kitsuruko@gmail.com>
This commit is contained in:
parent
5855601d59
commit
01338ff6ec
1 changed files with 6 additions and 2 deletions
|
@ -142,8 +142,12 @@ class Router
|
|||
#TODO: move this to delegateView
|
||||
|
||||
$tpl = $this->scope["_template"] ?? "$presenterName/$action.xml";
|
||||
if($tpl[0] !== "/")
|
||||
$tpl = CHANDLER_EXTENSIONS_ENABLED . "/$namespace/Web/Presenters/templates/$tpl";
|
||||
if($tpl[0] !== "/") {
|
||||
$dir = CHANDLER_EXTENSIONS_ENABLED . "/$namespace/Web/Presenters/templates";
|
||||
$tpl = "$dir/$tpl";
|
||||
if(isset($this->scope["_templatePath"]))
|
||||
$tpl = str_replace($dir, $this->scope["_templatePath"], $tpl);
|
||||
}
|
||||
|
||||
$output = $this->delegateView($tpl, $presenter);
|
||||
|
||||
|
|
Loading…
Reference in a new issue