@@ -134,12 +134,12 @@ |
||
| 134 | 134 | |
| 135 | 135 | // Preapare template folders |
| 136 | 136 | $template_folders = [ |
| 137 | - $theme_template_path, // Load this path first |
|
| 138 | - $this->dir_path // Load this path second |
|
| 139 | - ]; |
|
| 140 | - $loader = new \Twig_Loader_Filesystem($template_folders); |
|
| 141 | - $this->adapter->setLoader($loader); |
|
| 142 | - return $this; |
|
| 137 | + $theme_template_path, // Load this path first |
|
| 138 | + $this->dir_path // Load this path second |
|
| 139 | + ]; |
|
| 140 | + $loader = new \Twig_Loader_Filesystem($template_folders); |
|
| 141 | + $this->adapter->setLoader($loader); |
|
| 142 | + return $this; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | } |
| 146 | 146 | \ No newline at end of file |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $method_name = 'load'.ucfirst($adapter_name); |
| 87 | 87 | if(method_exists($this, $method_name)) { |
| 88 | 88 | $this->$method_name(); |
| 89 | - }else{ |
|
| 89 | + } else{ |
|
| 90 | 90 | exit; |
| 91 | 91 | //throw new \Exception(__("Could not load adapter $adapter_name", "va-templater")); |
| 92 | 92 | } |
@@ -106,8 +106,7 @@ discard block |
||
| 106 | 106 | if($this->adapter_name == 'twig') |
| 107 | 107 | { |
| 108 | 108 | return $this->adapter->render($template, $data); |
| 109 | - } |
|
| 110 | - elseif($this->adapter_name == 'blade') |
|
| 109 | + } elseif($this->adapter_name == 'blade') |
|
| 111 | 110 | { |
| 112 | 111 | return $this->adapter->view()->make($template,$data)->render(); |
| 113 | 112 | } |
@@ -76,12 +76,12 @@ |
||
| 76 | 76 | */ |
| 77 | 77 | public function setWordPressThemeSupport($app_name) { |
| 78 | 78 | $template_folders = [ |
| 79 | - get_template_directory() . '/templates/'. $app_name, |
|
| 80 | - $this->dir_path |
|
| 81 | - ]; |
|
| 82 | - $loader = new \Twig_Loader_Filesystem($template_folders); |
|
| 83 | - $this->adapter->setLoader($loader); |
|
| 84 | - return $this; |
|
| 79 | + get_template_directory() . '/templates/'. $app_name, |
|
| 80 | + $this->dir_path |
|
| 81 | + ]; |
|
| 82 | + $loader = new \Twig_Loader_Filesystem($template_folders); |
|
| 83 | + $this->adapter->setLoader($loader); |
|
| 84 | + return $this; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | } |