Add pushOnce and prependOnce helper directives

This commit is contained in:
Kijin Sung 2023-10-18 21:16:39 +09:00
parent 6b2b3f0dc2
commit 3c401bbc20
2 changed files with 22 additions and 5 deletions

View file

@ -2,9 +2,13 @@
<?php $foo = 42; ?>
@push('cms')
@pushOnce('cms')
<li>XE</li>
@endpush
@endpushOnce
@pushonce('cms')
<li>XE</li>
@endPushOnce
@push('cms')
<li>WordPress</li>
@ -14,9 +18,13 @@
<li>Drupal</li>
@endPushIf
@prepend('cms')
@prependOnce('cms')
<li>Rhymix</li>
@endprepend
@endPrependOnce
@prependonce('cms')
<li>Rhymix</li>
@endprependonce
@prependIf(!$foo, 'cms')
<li>Joomla</li>