n:macro always behaving as “inner”
Notice: This thread is very old.
- amik
- Member | 118
Hi, is it possible to write an n:macro always wrapping inner content of the element like this?
<div class="foo bar" n:upper>
upper
</div>
should compile into
<div class="foo bar">
<?php ob_start(); ?>
upper
<?php echo strtoupper(ob_get_clean()); ?>
</div>
I don't want to write n:inner-upper always, and I don't want to allow tag- and default variants.
Note: I'm not really building a macro for uppering content, I'm building a macro to replace element's inner content with user-editable content, I've written this example just to simply explain stuff.
Last edited by amik (2015-10-05 14:55)
- David Grudl
- Nette Core | 8252
Currently it is not possible. n:snippet
works this way, but it
is done as hack.