plates icon indicating copy to clipboard operation
plates copied to clipboard

Expected behaviour for multiple sections build over multiple layouts

Open RobinDev opened this issue 2 years ago • 1 comments

Example will be more explicit :+1:

  • I have template files :
<!-- test.html.php -->
<?= $this->section('exampleSection')?>
<!-- test2.html.php -->
<?php $this->layout('test.html') ?>


<?= $this->start('exampleSection')?>
    From test2.html
<?= $this->stop()?>
<!-- test3.html.php -->
<?php $this->layout('test2.html') ?>


<?= $this->start('exampleSection')?>
    From test3.html
<?= $this->stop()?>

I may expect this result if I render test3.html.php :

    From test3.html

I get :

    From test2.html

When Plates was designed, what was the expected result for some kind for code ? ( I can do a PR, but I think it must be discussed about the expected behaviour, I am switching from twig to plates so I try to find some similar logical).

RobinDev avatar Oct 05 '23 06:10 RobinDev

Proposal : https://github.com/RobinDev/plates/tree/replaceSection-like-twig-2

RobinDev avatar Oct 05 '23 07:10 RobinDev