07 – Debugging Kazoo Templates
Now that we are getting into building more complex templates we need to take a look at the debugging capabilities of the template engine used by Kazoo, namely KudzuPHP. Because the vast majority of mistakes are cause by missing end tags or typos within tags debugging designed to help you insure the structural integrity of your templates more than anything else.
Debugging is accomplished by setting the debug flag on the template engine prior to parsing/executing a template. There are two ways to accomplish this:
- PHP code:
$eng->setDebug(true); - shortcode:
[kazoo src='3' isdebug='true'] [/kazoo]
The result is that Kazoo writes your template’s tag structure out to you in an indented hierarchy so that you can see exactly how the template compiler interprets your template. Usually this is all it takes weed out the vast majority of problems. There’s no integrated debugging, no checking tags for validity at this time: See below for actual output:
01: |<!--{getposts|post_type=page&post_paren ... }-->
02: | |<!--{post}-->
03: | | |<!--{subst}-->
03: | | |<!--{/subst}-->
02: | |<!--{/post}-->
02: | |<!--{else}-->
02: | |<!--{/else}-->
01: |<!--{/getposts}-->
