Skip to content

Conversation

@AD7six
Copy link
Member

@AD7six AD7six commented Feb 12, 2015

The current Template task, is renamed BakeTemplate; the current view task is renamed Template task.

Ref: #2

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
@AD7six AD7six added this to the 1.0.0 milestone Feb 12, 2015
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
@AD7six
Copy link
Member Author

AD7six commented Feb 12, 2015

@josegonzalez Need to coordinate merging this one with you to prevent migrations breaking.

@markstory
Copy link
Member

It would be nice to leave a stub ViewTask so people can find out what the new command name is.

@AD7six
Copy link
Member Author

AD7six commented Feb 12, 2015

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.

@AD7six
Copy link
Member Author

AD7six commented Feb 12, 2015

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.');

@markstory
Copy link
Member

@AD7six I think that warning is enough.

@antograssiot
Copy link
Contributor

👍
I've done some docs update proposal regarding this modification.

@AD7six
Copy link
Member Author

AD7six commented Feb 14, 2015

@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
AD7six added a commit that referenced this pull request Feb 14, 2015
Rename view usage/references to template
@AD7six AD7six merged commit 82e5c43 into master Feb 14, 2015
@AD7six AD7six deleted the normalize-view branch February 14, 2015 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants