• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Layout question

#1
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 Smile

Emmanuel
Reply


Messages In This Thread
Layout question - by eincandela - 03-12-2019, 12:12 PM
RE: Layout question - by kilishan - 03-12-2019, 03:09 PM
RE: Layout question - by eincandela - 03-12-2019, 03:18 PM
RE: Layout question - by kilishan - 03-12-2019, 03:26 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.