I am trying to make simple custom tags to allow custom templates on my app. But I can't figure out how to parse and replace the tags.
(example)
<div class="blog">
<module display="posts" limit="10" show="excerpt" />
</div>
<div class="sidebar">
<module display="users" limit="5" />
<module display="comment" limit="10" />
</div>
for each found module tag, I want to run the module creation function with the parameters (listed in the tag as attributes). And replace the module tag, with an actual HTML chunk that gets returned from the function.