Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
[SOLVED] Problems with displaying Partials
i have some problems with the get_partial() function.
Even when i try to use this, i got the following error message:
ErrorException [ Warning ]: array_key_exists() expects parameter 2 to be array, string given
APPPATH/classes/theme.php @ line 372
This is the bad code
if ( ! array_key_exists($section, $this->partials) or ! array_key_exists($view, $this->partials[$section]))
throw new \ThemeException(sprintf('No partial named "%s" can be found in the "%s" section.', $view, $section));
I checked the types from the used variables with:
\Debug::dump($section, $view, $this->partials);
and got me the following result:
APPPATH/classes/theme.php @ line: 370
(String): "navigation" (10 characters)
(String): "partials/navigation" (19 characters)
(Array, 2 elements)
will be executed in these two controllers:
Modules/admin/users Controller: (line 49)
will be exeucted in the admin default layout:
For me it looks good - correct me if something is wrong.
Thanks a lot
i solved the problem
checked the render() function and saw the "$this->partials" part.
Changed the code to
<?php echo $partials['subnavigation']; ?>
and it's working fine
Add a Comment
It looks like you're new here. If you want to get involved, click one of these buttons!
Apply for Membership
↳ Job Board
↳ Installation & Setup
↳ Tips and Tutorials
↳ Code share
In this Discussion