diff --git a/cake/console/libs/tasks/template.php b/cake/console/libs/tasks/template.php index 6fe7ddfed75..d68ba61fea5 100644 --- a/cake/console/libs/tasks/template.php +++ b/cake/console/libs/tasks/template.php @@ -26,6 +26,13 @@ class TemplateTask extends Shell { * @var array **/ var $templateVars = array(); + +/** + * Paths to look for templates on. + * + * @var array + **/ + var $templatePaths = array(); /** * Initialize callback * @@ -96,6 +103,9 @@ function generate($directory, $filename, $vars = null) { if ($vars !== null) { $this->set($vars); } + if (empty($this->templatePaths)) { + $this->initialize(); + } $templateFile = $this->_findTemplate($directory, $filename); if ($templateFile) { extract($this->templateVars);