Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
fix ctk themes baking. bake themes into correct folder. theme folder …
Browse files Browse the repository at this point in the history
…should contains 'ctk' substring
  • Loading branch information
skie committed May 15, 2013
1 parent a981980 commit 54554eb
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Console/Command/Task/ExtViewTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,26 @@ public function getOptionParser() {
;
}

public function bake($action, $content = '') {
if ($content === true) {
$content = $this->getContent($action);
}
if (empty($content)) {
return false;
}
$this->out("\n" . __d('cake_console', 'Baking `%s` view file...', $action), 1, Shell::QUIET);

$themePath = $this->Template->getThemePath();
$isCtk = strpos(strtolower($themePath), 'ctk') !== false;

$path = $this->getPath();
if ($isCtk) {
$filename = $path . $this->controllerName . DS . 'Ctk' . DS . Inflector::camelize(Inflector::underscore($action)) . 'View.php';
} else {
$filename = $path . $this->controllerName . DS . Inflector::underscore($action) . '.ctp';
}
return $this->createFile($filename, $content);
}


}

0 comments on commit 54554eb

Please sign in to comment.