Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Forcing templatePaths to exist.

  • Loading branch information...
commit a7f0071c610e56e718c83028631fa3b44a72ffc4 1 parent 333713e
Mark Story markstory authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 cake/console/libs/tasks/template.php
10 cake/console/libs/tasks/template.php
View
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.