Doc templates

Added documentation in phpdoc to templates.