CakePHP for TextMate

This article is also available in the following languages:
By kuja
Do you like Cake? Are you a TextMate user? Well, then maybe the CakePHP bundle for TextMate is just what you need!
Many of you TextMate users and CakePHP bakers may already be aware that once upon a time (until yesterday, actually) there existed a TM bundle for Cake, but it wasn't that great and it was never updated!

Well, I've taken this chance to refurbish what was there, merge my own changes and now I introduce to you a newer and quite possibly better CakePHP bundle for TextMate!

There is currently no release of the bundle, but it is sitting on the Macromates "review bundles" repository, and waiting for you to check it out!

You'll need the subversion client to do this. If you don't have SVN, refer to http://subversion.tigris.org/project_packages.html on installing it.

To checkout the bleeding-edge copy of this bundle and use it in your TextMate, simply copy/paste:

# if this directory doesn't exist, make it with `mkdir -p`
$ cd ~/Library/Application\ Support/TextMate/Bundles
$ svn co http://macromates.com/svn/Bundles/trunk/Review/Bundles/PHP\ Cake.tmbundle

Now all you need to do is run TextMate, open a PHP file and try it out!
Note: You'll first need to select the "HTML (PHP Cake)" language from the bottom drop-down list to apply the CakePHP scoping rules to your files. Setting this one will allow TextMate to remember forever. (.ctp and .thtml templates are automatically recognized).

That's all! I hope you enjoy the bundle, and if you have any questions or comments, any kind of feedback at all--do not hesitate to contact me on IRC (irc.freenode.net/#cakephp) or e-mail.

Comments

  • Posted 08/30/09 02:04:37 PM
  • Posted 01/28/09 10:42:39 PM
    I was just thinking there really ought to be a CakePHP bundle, and lo and behold. It seems really thorough too. But, it strikes me that it could make really good use of templates. The snippets for new models/views/controllers are great, but I wouldn't even have to remember them if there were a couple templates. (I'm trying to edit them in myself, but finding the process slightly frustrating due to my unfamiliarity with the way TextMate bundles work.)
  • Posted 08/19/08 07:46:58 AM
    Glad I came back to check this out, cause it finally made me start looking to figure it out. I had set the language to the "HTML (PHP CAKE)" originally, but didn't have any luck. Then i tried it again this morning, and no luck, then i tried saving the file, and it defaulted to .ctp and i didn't think anything of it, and after trying every shortcut down to views and controllers and having no luck except the views and controllers it finally dawned on me that i needed to have the file saved as .php. I had originally just tried the shortcuts in a new document and had no luck, so in case anyone is having an issue with it, make sure to save the file as .php first (or edit one of your other php files) and you're good to go. Sure would have saved me some time if i had just thought it through originally :P Thanks for a great bundle.
  • Posted 07/16/08 11:35:46 AM
    I've got the bundle showing up in my textmate and can use the items in the bundle but the shortcuts aren't working for me, trying newc doesn't get me anything, but it does work if i choose it from the bundle menu. Am I missing something? I've never had a problem with bundles before.
    • Posted 08/14/08 01:53:26 AM
      Jeremy, You need to select the "HTML (PHP Cake)" language from the window's bottom dropdown list to apply the CakePHP scoping rules. Then shortcuts will work.
  • Posted 07/15/08 04:29:57 AM
    The E TextEditor has support for this bundle also.
    A guide to installation is found at http://www.toadz.dk/install-cakephp-textmate-bundle-in-e-texteditor/
  • Posted 06/24/08 07:53:59 AM
    I might try and blog what I find as most useful functions if I Get time this week!

    There seem to be lots of command slooking through -

    for those who don't use bundles to much a great TextMate shortcut is control-command-T and then you see what commands are available and you can type tof ilter this even more!

    Luke / boobyWomack / battez
  • Posted 06/21/08 01:15:02 PM
    Beautiful job. I just installed and have yet to really use it, but just looking through the bundle editor I can see you were very thorough. Thanks a bunch.
  • Posted 06/14/08 09:41:51 AM
    Thanks, the exported variable did the trick.

    =]
  • Posted 06/14/08 02:55:02 AM
    Thanks, this is great, and will be very useful. For whatever reason, I had to go to "Bundle Editor", click "Filter List", and uncheck and check the PHP Cake bundle before it became available.
  • Posted 06/11/08 11:34:34 PM
    I got this error when I tried to check out the bundle:

    svn: Can't convert string from 'UTF-8' to native encoding:
    svn: PHP Cake.tmbundle/Snippets/Inflector::humanize(?\226?\128?\166).tmSnippet

    I'm running OS X 10.5.3
    • Posted 06/12/08 05:07:48 AM
      I got this error when I tried to check out the bundle:

      svn: Can't convert string from 'UTF-8' to native encoding:
      svn: PHP Cake.tmbundle/Snippets/Inflector::humanize(?\226?\128?\166).tmSnippet

      I'm running OS X 10.5.3

      Try executing the following command:
      $ export LC_CTYPE=en_US.UTF-8

      And then try checking out from the repository again.

      Most TextMate bundles (include the CakePHP bundle) use UTF-8 characters, therefor things might break on default terminal settings, but altering $LC_CTYPE to use a UTF-8 locale should fix it.

Comments are closed for articles over a year old