Skip to content

Commit

Permalink
Forcing templatePaths to exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed May 14, 2009
1 parent 333713e commit a7f0071
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cake/console/libs/tasks/template.php
Expand Up @@ -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
*
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a7f0071

Please sign in to comment.