Business, Tech, Life, and Whatever else

CodeIgniter TextMate Bundles

by Eric Barnes on November 2, 2009

One of the best things about working with TextMate is the powerful bundle system it includes. I have been using it a lot lately with the CodeIgniter bundle. Here are two that are worth looking at:

Either one of those cover pretty much everything except the automatic creation of models and controllers. Since models and controllers require you to have the class name the same as the file name it would make sense and be a lot easier to just have this automatically happen when you call the bundle.

For my projects I created a new command that would do this automatically for you. Here is how I did it.

Step 1.

Open the textmate bundle editor and add a “new command”:

New Command

New Command

Step 2.

Now on the right side of the bundle editor set it up like this screen shot:

Edit Command

Edit Command

Step 3.

The final step is to now insert the code to create the model for you. Here is the code I used:

If you look at those you will notice I am just using the global TM_FILENAME and then using php to process it into a workable format. Pretty easy but a huge time saver. If you have TextMate tips or improvements for this code please be sure and comment below.

Download

Here is a direct download of the bundle for this tutorial which includes the model, controller, and one for the end of the file:

You May Also Be Interested In...

Extending the core Controller in CodeIgniter
July 7, 2009

68 Classifieds – TextMate Bundle
June 29, 2009

Code Igniter Template Tutorial
July 7, 2008

CodeIgniter with TinyMCE
March 4, 2009

Subscribe Now

If you enjoyed this post, you will definitely enjoy my others. Subscribe to the feed to get instantly updated for those awesome posts soon to come.


blog comments powered by Disqus