Skip to content

Commit a02794a

Browse files
committed
Remove App::objects() call.
Using bake templates now requires you to load a plugin. I don't see this as a huge obstacle if you want to use templates from a plugin. This also fixes issues where plugins not using `src/` would not work with TemplateTask.
1 parent 3c00ea4 commit a02794a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Console/Command/Task/TemplateTask.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
use Cake\Console\Shell;
1818
use Cake\Core\App;
19+
use Cake\Core\Plugin;
1920
use Cake\Utility\ConventionsTrait;
2021
use Cake\Utility\Folder;
2122
use Cake\View\ViewVarsTrait;
@@ -57,9 +58,9 @@ public function initialize() {
5758
protected function _findTemplates() {
5859
$paths = App::path('Template');
5960

60-
$plugins = App::objects('Plugin');
61+
$plugins = Plugin::loaded();
6162
foreach ($plugins as $plugin) {
62-
$paths[] = $this->_pluginPath($plugin) . 'src' . DS . 'Template' . DS;
63+
$paths[] = Plugin::classPath($plugin) . DS . 'Template' . DS;
6364
}
6465

6566
$core = current(App::core('Template'));

0 commit comments

Comments
 (0)