Template-Snippet is a project mainly written in PHP, it's free.
Example snippet for modx templates
404: Not Found