UPDATE: Introductory concept on reusable functions is published.

This simple example demonstrates anonymous and regular functions designed to be callbacks.

Code: Select all
<cms:func 'purchase' product='' amount='' reason=''>
    <p>
        I have purchased a <cms:show product /> for <cms:show amount />.<br>
        I want to <cms:call reason />
    </p>
</cms:func>
<cms:func _into='travel'>see the world.</cms:func>
<cms:func _into='donate'>donate it to charity.</cms:func>
<cms:func 'gift'>send it as a present.</cms:func>

<cms:call 'purchase' 'phone' '$200' 'gift' />
<cms:call 'purchase' 'toy' '$100' donate />
<cms:call 'purchase' 'tour' '$500' travel />


Here is another example with a more 'real-world' application of callbacks: Cms-Fu Sapling » embed