-
Notifications
You must be signed in to change notification settings - Fork 100
Rename view usage/references to template #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
As, the view task needs to be renamed Template to be consistent
You don't bake a view (well, in the future you'll be able to) - so change all internal references to view to be template
I.e. like this:
Available bake commands:
- all
- behavior
- cell
- component
- controller
- fixture
- helper
- migration
- model
- plugin
- shell
- template
- test
Not this:
Available bake commands:
- all
- fixture
- test
- behavior
- helper
- shell
- controller
- model
- plugin
- template
- cell
- component
- migration
9408341 to
dc6a3d6
Compare
Otherwise postgres be sad
|
@josegonzalez Need to coordinate merging this one with you to prevent migrations breaking. |
|
It would be nice to leave a stub ViewTask so people can find out what the new command name is. |
|
I'm not sure that's a good idea. You can't right now bake a view class, and unless the syntax changes, that would block adding that possibility. |
|
I can do this if we do want to point users in the right direction: diff --git src/Shell/BakeShell.php src/Shell/BakeShell.php
index ecc6845..d35de60 100644
--- src/Shell/BakeShell.php
+++ src/Shell/BakeShell.php
@@ -72,6 +72,16 @@ class BakeShell extends Shell
*/
public function main()
{
+ if ($this->args && $this->args[0] === 'view') {
+ $this->out('<error>The view command has been renamed</error>');
+ $this->out('To create template files, use the template comand:', 2);
+ $args = $this->args;
+ array_shift($args);
+ $args = implode($args, ' ');
+ $this->out(sprintf(' bin/cake bake template %s', $args), 2);
+ return false;
+ }
+
$connections = ConnectionManager::configured();
if (empty($connections)) {
$this->out('Your database configuration was not found.'); |
|
@AD7six I think that warning is enough. |
|
👍 |
|
@antograssiot awesome, thanks! |
The test relied on the fact that setUp will put a model in the table registry with the key "TemplateTaskComments"; and that the table registry would return this instance for that key or "anything.TemplateTaskComments". So, stick the same table class in the table registry so it can be found
Rename view usage/references to template
The current Template task, is renamed BakeTemplate; the current view task is renamed Template task.
Ref: #2