Layout question |
03-12-2019, 11:12 AM
(This post was last modified: 03-12-2019, 02:12 PM by eincandela. Edit Reason: typo )
Hello,
i'm a little suprised by the way the layout system in CI4 works (or maybe i didn't understand it correctly) As far as i get it from the docs, the view file must declare the layout it is inserted into by: <?= $this->extend('default') ?> <?= $this->section('content') ?> <h1>Hello World!</h1> <?= $this->endSection() ?> But why should it be the responsibility of the view file to know that info? If i go the CI4 approach and want to reuse a page into another layout i have to duplicate it (or tweak it by passing a view name into a variable) + if i want to change the layout for a bunch of page, i have to modify all of them. I can find my peace with that by tweaking it a little, but i don't see the pros of that design choice ? Any opinion welcomed Emmanuel |
Messages In This Thread |
Layout question - by eincandela - 03-12-2019, 11:12 AM
RE: Layout question - by kilishan - 03-12-2019, 02:09 PM
RE: Layout question - by eincandela - 03-12-2019, 02:18 PM
RE: Layout question - by kilishan - 03-12-2019, 02:26 PM
|