@@ -142,7 +142,7 @@ public function __construct(ViewConfig $config, string $viewPath = null, FileLoc
142142 $ this ->loader = $ loader ?? Services::locator ();
143143 $ this ->logger = $ logger ?? Services::logger ();
144144 $ this ->debug = $ debug ?? CI_DEBUG ;
145- $ this ->saveData = $ config ->saveData ?? null ;
145+ $ this ->saveData = ( bool ) $ config ->saveData ;
146146 }
147147
148148 //--------------------------------------------------------------------
@@ -156,7 +156,7 @@ public function __construct(ViewConfig $config, string $viewPath = null, FileLoc
156156 * - cache_name Name to use for cache
157157 *
158158 * @param string $view File name of the view source
159- * @param array $options Reserved for 3rd-party uses since
159+ * @param array|null $options Reserved for 3rd-party uses since
160160 * it might be needed to pass additional info
161161 * to other template engines.
162162 * @param boolean|null $saveData If true, saves data for subsequent calls,
@@ -176,7 +176,7 @@ public function render(string $view, array $options = null, bool $saveData = nul
176176 $ fileExt = pathinfo ($ view , PATHINFO_EXTENSION );
177177 $ realPath = empty ($ fileExt ) ? $ view . '.php ' : $ view ; // allow Views as .html, .tpl, etc (from CI3)
178178 $ this ->renderVars ['view ' ] = $ realPath ;
179- $ this ->renderVars ['options ' ] = $ options ;
179+ $ this ->renderVars ['options ' ] = $ options ?? [] ;
180180
181181 // Was it cached?
182182 if (isset ($ this ->renderVars ['options ' ]['cache ' ]))
@@ -277,7 +277,7 @@ public function render(string $view, array $options = null, bool $saveData = nul
277277 * Cache does not apply, because there is no "key".
278278 *
279279 * @param string $view The view contents
280- * @param array $options Reserved for 3rd-party uses since
280+ * @param array|null $options Reserved for 3rd-party uses since
281281 * it might be needed to pass additional info
282282 * to other template engines.
283283 * @param boolean|null $saveData If true, saves data for subsequent calls,
0 commit comments