CakePHP for TextMate

By Matthew Harris (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 689

CakePHP Team Comments Author Comments
 

Bug

1 Error checking out bundle...

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 Jun 11, 2008 by Dave Bullock
 

Comment

2 Locale

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.
Posted Jun 12, 2008 by Matthew Harris
 

Comment

3 Excellent work

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 Jun 14, 2008 by Grrr
 

Comment

4 That worked...

Thanks, the exported variable did the trick.

=]
Posted Jun 14, 2008 by Dave Bullock
 

Comment

5 Great Work

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 Jun 21, 2008 by Nate Todd
 

Comment

6 nice work

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 Jun 24, 2008 by Luke Barker
 

Comment

7 Also useable in E TextEditor under Windows

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 Jul 15, 2008 by Kasper
 

Comment

8 Shortcuts not working

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 Jul 16, 2008 by Jeremy Halvorsen
 

Comment

9 Select the HTML (PHP Cake) language first

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 Aug 14, 2008 by Andrew Kolesnikov
 

Comment

10 I figured it out

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 Aug 19, 2008 by Jeremy Halvorsen