Thursday, March 5, 2009

smarty $compile_id for different $template_dirs

We might have different template dirs storing template files with an identified name. For example, we could have /Auth/index.tpl, /Buy/index.tpl. However, Smarty uses only one compile dir, and Smarty is not that smart. To display the two index.tpl correctly, we must specify $compile_id. If you set a distinct $compile_id for each template_dir, then Smarty can tell the compiled templates apart by their $compile_id.

No comments: