CakePHP: baking cake in Windows

There are a lot of articles on the internet on how to make CakePHP and it’s bake function to work in Windows.

I have tried setting the PATH environment variable to match the console

PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\xampp\php;c:\xampp\cake\cake\console\

No avail. So I am just doing this instead after creating the databases.

  1. Click Start > Run.
  2. Type cmd then press Enter.
  3. Change directory to where my extracted CakePHP files were
    cd \xampp\htdocs\cake (press enter)
  4. Type: cake\console\cake bake all
  5. That’s it. All is well.

If you guys know how to make Windows recognize the cake.bat file to execute when it’s folder is included in the path, feel free to comment.

NOTE: I am not using the production setup of CakePHP and the command may vary depending on that. Please feel free to correct.

Notepad++ : Associate CTP file extension to PHP language

I am playing around with CakePHP (yet again) lately and found that I need to make the syntax highlighting to format the same way PHP files are formatted.

CTP files are simply the file extension for template files or views file extension for CakePHP.

The workaround:

  1. Click Settings > Style configurator
  2. Click PHP under Language
    NOTE: I chose PHP cause it’s formatting the HTML and the PHP code inside.
  3. Type ctp under user ext. (extension)
  4. Click Save and close.

You’re done!

NOTE: Also applicable when adding other file extension to a certain language.

Style configurator

Src: http://is.gd/6hAga

Loading image

Click anywhere to cancel

Image unavailable

Loading image

Click anywhere to cancel

Image unavailable