• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI4 beta.1 - How to load view in view with layout

#1
Hello,

In beta 1, how can I load a partial view in a view with layout?

When I use this code, nothing is rendered. 
PHP Code:
<?= $this->extend('layout'?>

<?= $this->section('content'?>
    <?= view('partial'); ?>
    <h1>Hello World!</h1>
<?= $this->endSection() ?>


But without layout, it will work.
PHP Code:
<?= view('partial'); ?>
<h1>Hello World!</h1> 
Reply


Messages In This Thread
CI4 beta.1 - How to load view in view with layout - by pinebranch - 03-08-2019, 01:40 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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