CodeIgniter Forums

Full Version: Issue with layouts renderer and sections => merge sections in one view
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

It seems that there is a problem with the layouts and I think that this is due to "ob_start / ob_flush / ..." in the renderer.
It will be easier to explain my problem with an example...

PHP Code:
public function send(): string
    $email view('email');
// Send email script here...

    return view('confirmation');

View "email" extends a layout "x" with a section called "body".
View "confirmation" extends another layout "y" with a section called "body".

Sometimes (but not always), "view('confirmation')" displays the "body" section of "email" and "confirmation". The renderer merges both sections even if the layout is not the same.
This is really annoying. For the moment, I try to prefix all my sections in each layouts but it would be better if I didn't have to do this kind of things.
Good point. PLease log that over at Github.
(01-16-2020, 08:15 AM)kilishan Wrote: [ -> ]Good point. PLease log that over at Github.

Done ;-)