Conditions | 4 |
Paths | 8 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
38 | public function bake($template, $content = '', $outputFile = null) |
||
39 | { |
||
40 | if ($outputFile === null) { |
||
41 | $outputFile = $template; |
||
42 | } |
||
43 | if ($content === true) { |
||
44 | $content = $this->getContent($template); |
||
45 | } |
||
46 | if (empty($content)) { |
||
47 | $this->err("<warning>No generated content for '{$template}.ctp', not generating template.</warning>"); |
||
48 | |||
49 | return false; |
||
50 | } |
||
51 | $this->out("\n" . sprintf('Baking `%s` view twig template file...', $outputFile), 1, Shell::QUIET); |
||
52 | $path = $this->getPath(); |
||
53 | $filename = $path . Inflector::underscore($outputFile) . '.twig'; |
||
54 | $this->createFile($filename, $content); |
||
55 | |||
56 | return $content; |
||
57 | } |
||
58 | } |
||
59 |