@@ -79,6 +79,7 @@ discard block |
||
79 | 79 | * Load adapter, currently we are using 2 adapters: twig and blade |
80 | 80 | * |
81 | 81 | * @var $adapter_name string Path to template folder. |
82 | + * @param string $adapter_name |
|
82 | 83 | * @return Twig_Environment || Blade |
83 | 84 | */ |
84 | 85 | public function loadAdapter($adapter_name) { |
@@ -121,7 +122,7 @@ discard block |
||
121 | 122 | * |
122 | 123 | * @var $app_name string Your application name, should be lowercase, letters only. |
123 | 124 | * |
124 | - * @return object \VA\Templater\Engine |
|
125 | + * @return Templater \VA\Templater\Engine |
|
125 | 126 | */ |
126 | 127 | public function setWordPressThemeSupport($app_name) { |
127 | 128 | // Path to templates folder in wordpress theme |
@@ -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 |
@@ -39,6 +39,7 @@ discard block |
||
39 | 39 | * Load Twig as default adapter |
40 | 40 | * |
41 | 41 | * @var $dir_path string Path to template folder. |
42 | + * @param string $dir_path |
|
42 | 43 | * @return Twig_Environment |
43 | 44 | */ |
44 | 45 | public function loadTwig($dir_path) { |
@@ -72,7 +73,7 @@ discard block |
||
72 | 73 | * |
73 | 74 | * @var $app_name string Your application name, should be lowercase, letters only. |
74 | 75 | * |
75 | - * @return object \VA\Templater\Engine |
|
76 | + * @return Engine \VA\Templater\Engine |
|
76 | 77 | */ |
77 | 78 | public function setWordPressThemeSupport($app_name) { |
78 | 79 | $template_folders = [ |
@@ -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 | } |