When I start with CakePHP at the beginning I created my views, controllers and models manually. It was a lot of work to do the initial process especially when I still learned the Framework. Then I found /I cannot remember where, probably in another blog/, bake.php script in the {cakeproject}/cake/scripts/ directory which simplified very much the initial process.

So far I am working for the Italian market and I don’t have any particular knowledge in Italian. The communication between me and my colleagues is in English,but the final product should be in Italian, so the Translation is really necessary.

With bake.php the initialization was very easy, but the Translation and some additional requirements which we had, missing in the script and caused more work than help. When I start with bake.php script I wanted to make these changes in th beggining but to do that I had to touch in file with 2000 lines of code with long string variables which hold the templates. It was pain to understand the logic. That’s why I prefered to generate all files and then to go through them and to make necessary changes.

Few months back CakePHP release 1.2beta of the Framework and the bake.php script evolve in cake.php placed in {cakeproject}/cake/console directory. The bake section was fully templatized and now everything which you need to touch is outside in template files placed under {cakeproject}/cake/console/libs/templates/views directory. There are home.ctp, form.ctp, index.ctp and view.ctp which could be modified before the initial build of all views. You have to touch them very carefully, but once you make the changes the script will use these files and will save a lot of work and believe me - that’s really help!

Tags: , , , , , ,



Add to: del.icio.us:Modify templates before start baking... digg:Modify templates before start baking... spurl:Modify templates before start baking... wists:Modify templates before start baking... simpy:Modify templates before start baking... newsvine:Modify templates before start baking... blinklist:Modify templates before start baking... furl:Modify templates before start baking... reddit:Modify templates before start baking... fark:Modify templates before start baking... blogmarks:Modify templates before start baking... Y!:Modify templates before start baking... smarking:Modify templates before start baking... magnolia:Modify templates before start baking... segnalo:Modify templates before start baking... gifttagging:Modify templates before start baking...

2 Comments to “Modify templates before start baking…”

  1. Richard@HomeNo Gravatar | October 23rd, 2007 at 5:13 pm

    http://cakebaker.42dh.com/2007/06/11/baking-views/ goes into a little more detail about creating your own bake templates.

    A better place to put them is

    /app/vendors/shells/templates/views

    because they wont be overwritten if you upgrade the cake install.

    Hope this helps.

  2. Nik ChankovNo Gravatar | October 23rd, 2007 at 5:37 pm

    @Richard,
    You are completelly right. I also didnt like the possibility to “touch” anything in the cake folder.
    The place, where the app templates should be is quite strange, but anyway, better there than in cake.

    Thanks for the info!

Leave a Comment

*
To prove that you're not a bot, enter this code
Anti-Spam Image