Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace section like twig #322

Open
wants to merge 4 commits into
base: v3
Choose a base branch
from

Conversation

RobinDev
Copy link

  1. NO Bc Break

  2. Be able to have multiple children rendering the same section. Eg :

Actually

<!-- file1.php -->
<?= $this->section('exampleSection') ?>
<?php $this->layout('file1.php') ?>
<!-- file2.php -->
<?= $this->start('exampleSection'))  ?>
<?php sleep(12) ?>
<?php $this->stop() ?>
<?php $this->layout('file2.php') ?>
<!-- file3.php -->
<?= $this->start('exampleSection')) ?>
<?php sleep(8) ?>
<?php $this->stop() ?>

If i render file3.php, i will wait 12 + 8 seconds.

With this fork

<!-- file1.php -->
<?= $this->section('exampleSection') ?>
<!-- file2.php -->
<?= if ($this->start('exampleSection')) { ?>
<?php sleep(12) ?>
<?php } $this->stop() ?>
<!-- file3.php -->
<?= if ($this->start('exampleSection')) { ?>
<?php sleep(8) ?>
<?php } $this->stop() ?>

If i render file3.php, i will wait 8 seconds.

Hope I am enough clear.

@ragboyjr
Copy link
Contributor

ragboyjr commented Nov 2, 2024

This is interesting, let me think on this for a bit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants