Skip to content
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

How to bake using templates? #7

Closed
cnizzardini opened this issue Dec 18, 2014 · 3 comments
Closed

How to bake using templates? #7

cnizzardini opened this issue Dec 18, 2014 · 3 comments
Labels
Milestone

Comments

@cnizzardini
Copy link

Where do templates go now that this has been moved into a plugin? Before we could put custom templates in src/Template/Bake/ but the plugin doesn't appear to read these. I tried putting my template in plugins/Bake/src/Template/ but this didn't seem right, nor did it work.

Is this even at a stage where I should be using it?

@markstory markstory added the bug label Dec 18, 2014
@cnizzardini
Copy link
Author

I read through the code, it looks like for this functionality I need to create a new plugin that contains src/Template/Bake within it. I tried this and it appeared to work after creating a plugin called "Scaffold" and copying plugins/Bake/src/Template/Bake over to it.

I guess this is the intended use?

@AD7six
Copy link
Member

AD7six commented Dec 18, 2014

Where do templates go now that this has been moved into a plugin?

They go in a plugin if it's a bake theme - or if you want to override the default template set you can put them in your application's src/Template/Bake folder:

-> cat src/Template/Bake/Shell/shell.ctp 
<?php

//This is my bake template
www-data @ dev [ /var/www/cakephp.dev ] (master $%=)
-> bin/cake bake shell Example

Welcome to CakePHP v3.0.0-beta3 Console
---------------------------------------------------------------
App : src
Path: /var/www/cakephp.dev/src/
---------------------------------------------------------------

Creating file /var/www/cakephp.dev/src/Shell/ExampleShell.php
Wrote `/var/www/cakephp.dev/src/Shell/ExampleShell.php`

Baking test case for App\Shell\ExampleShell ...

Creating file /var/www/cakephp.dev/src/tests/TestCase/Shell/ExampleShellTest.php
Wrote `/var/www/cakephp.dev/src/tests/TestCase/Shell/ExampleShellTest.php`
www-data @ dev [ /var/www/cakephp.dev ] (master $%=)
-> cat src/Shell/ExampleShell.php 
<?php

//This is my bake template
www-data @ dev [ /var/www/cakephp.dev ] (master $%=)
-> 

Before we could put custom templates in src/Template/Bake/

Are you sure the overriden bake template files are in the right place? Note that template file names changed compared to earlier cakephp 3.x releases; perhaps some verbose output could be added to indicate where bake is looking for and finding template files.

Is this even at a stage where I should be using it?

It should definitely be usable - if not we'd like to know about it =)

@AD7six AD7six added question and removed bug labels Dec 18, 2014
@markstory markstory added this to the 1.0.0 milestone Dec 18, 2014
@AD7six
Copy link
Member

AD7six commented Dec 23, 2014

Closing as this looks like a misunderstanding rather than a problem in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants