@@ -182,6 +182,16 @@ public function getDefaultExtension(): string
182182 return $ this ->defaultExtension ;
183183 }
184184
185+ /**
186+ * Gets the theme instance, or null if no theme has been set.
187+ *
188+ * @return Theme The theme instance, or null if no theme has been set.
189+ */
190+ public function getTheme (): ?Theme
191+ {
192+ return $ this ->theme ;
193+ }
194+
185195 /**
186196 * Sets a common parameters that is accessible in all view templates.
187197 *
@@ -331,8 +341,8 @@ final public function setPlaceholderSalt(string $salt): void
331341 *
332342 * The view to be rendered can be specified in one of the following formats:
333343 *
334- * - the name of the view starting with a slash. to join the base path {@see getBasePath()} (e.g. "/site/index").
335- * - the name of the view without the starting slash (e.g. "site/index"). The corresponding view file will be
344+ * - The name of the view starting with a slash to join the base path {@see getBasePath()} (e.g. "/site/index").
345+ * - The name of the view without the starting slash (e.g. "site/index"). The corresponding view file will be
336346 * looked for under the {@see ViewContextInterface::getViewPath()} of the context set via {@see withContext()}.
337347 * If the context instance was not set {@see withContext()}, it will be looked for under the directory containing
338348 * the view currently being rendered (i.e., this happens when rendering a view within another view).
@@ -362,10 +372,10 @@ public function render(string $view, array $parameters = []): string
362372 * If the theme was not set {@see withTheme()}, it will try to render the themed version of the view file
363373 * as long as it is available.
364374 *
365- * If the theme was not set {@see withRenderers()}, the method will use it to render the view file. Otherwise,
375+ * If the renderer was set {@see withRenderers()}, the method will use it to render the view file. Otherwise,
366376 * it will simply include the view file as a normal PHP file, capture its output and return it as a string.
367377 *
368- * @param string $viewFile The view file. This can be either an absolute file path or an alias of it .
378+ * @param string $viewFile The full absolute path of the view file .
369379 * @param array $parameters The parameters (name-value pairs) that will be extracted and made available in the view
370380 * file.
371381 *
@@ -524,7 +534,7 @@ public function clear(): void
524534 protected function findTemplateFile (string $ view ): string
525535 {
526536 if ($ view !== '' && $ view [0 ] === '/ ' ) {
527- // path relative to basePath e.g. "// layouts/main"
537+ // path relative to basePath e.g. "/layouts/main"
528538 $ file = $ this ->basePath . '/ ' . ltrim ($ view , '/ ' );
529539 } elseif (($ currentViewFile = $ this ->getRequestedViewFile ()) !== null ) {
530540 // path relative to currently rendered view
0 commit comments