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

Before and After functions #3

Open
dwest opened this issue Jul 17, 2012 · 0 comments
Open

Before and After functions #3

dwest opened this issue Jul 17, 2012 · 0 comments
Assignees

Comments

@dwest
Copy link
Owner

dwest commented Jul 17, 2012

Sometimes you want to append or prepend something to the parent's content instead of replacing it outright. This is not currently possible with append/prepend because they work only in the parent template. To that end we should add before and after functions that work outside of the normal blocks and are only concatenated after the block is full processed.

For example:

===File A===

Default

===File B===

<?php $after('content')?>
<div>After</div>
<?php $end('content')?>

===File C===

<?php $before('content')?>
<div>Before</div>
 <?php $end('content")?>

<?php $block('content')?>
<div>Override</div>
<?php $end('content')?>

Would produce:

Before

Override

After

@ghost ghost assigned dwest Jul 17, 2012
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

No branches or pull requests

1 participant