blog.Resource

Archive:

News-Feeds:


RSS 2.0
RSS 0.91
RDF
ATOM 0.3
June 23, 2008

TextMate Bundle: TYPO3 Extension Development

Category: Zachary Davis, TYPO3

By: Zach Davis, Cast Iron Coding LLC

Check out Cast Iron Coding's TextMate bundle aimed at making life easier for TYPO3 extension developers.

We use TextMate a lot in our agency -- it's one of those development tools I've come to feel I can't live without. One of the nicest features of Textmate is the built-in customization capabilities. You may be familiar with the TypoScript bundle released by Sudaru Williams about a year ago. This bundle contains some quick and easy shortcuts for common tasks while working with TYPO3, both in TypoScript and PHP and serves as a nice complement to that bundle.

We're going to continue building this bundle, and should there be a demand, we can keep updates available on our website. If there's anything you'd like to see added or changed, send it our way, and we'll add it to the bundle.

Here's the list of snippets and commands available in this iteration of the bundle:

DB: exec_INSERTquery
What it does: inserts PHP code for inserting records into the database using TYPO3's database API
To use: type "t3ins" then [TAB]. Type the table name. With Textmate you can quickly duplicate the $dataArr[''] = ''; line by typing [OPTION]-[SHIFT]-d.

DB: exec_SELECTquery
What it does: inserts PHP code for select records from the database using TYPO3's database API
To use: type "t3sel" then [TAB]. Hitting [TAB] will bring you through each variable: $select, $table, etc. Skip past the ones you don't need to set.

DB: exec_UPDATEquery
What it does: inserts PHP code for updating data records using TYPO3's database API
To use: type "t3upd" then [TAB]. Hitting [TAB] will bring you through each variable: $table and $where. With Textmate you can quickly duplicate the $dataArr[''] = ''; line by typing [OPTION]-[SHIFT]-d.

DB: fullQuoteStrWhat it does: inserts PHP code for escaping a string value before using it in the query. Very useful for the WHERE clause.
To use: type [OPTION]-[COMMAND]-f. Type the value to escape.

DB: sql_insert_idWhat it does: inserts PHP code for getting the id of a just-inserted record using TYPO3's database API
To use: type "t3insid" then [TAB]

t3lib_div::debugWhat it does: inserts a call to t3lib_div::debug
To use: type [OPTION]-[COMMAND]-b. Type the variable name you want to debug, hit [TAB], then type the label for your debug.

TYPO3 IP MatchWhat it does: inserts an if that checks whether the remote IP address is your IP address. Useful for taking a different course of action when you or another computer at your IP address is looking at the site.
To use: type "ifip" then [TAB]. Add code inside the if.

TYPO3 IP Match Debug
What it does: same as above, but also adds a debug so that the debug only appears for computers at your IP address
To use: type "ifipdb" then [TAB]. Tab through first and second arguments of debug method call.

PHP.net current work lookupWhat it does: looks up the current word on php.net
To use: place cursor in the lookup word, type [OPTION]-[COMMAND]-p.

TYPO3 API lookup
What it does: looks up the current word in the TYPO3 API docs
To use: place cursor in the lookup word, type [OPTION]-[COMMAND]-a.

You may download the bundle here. We hope you find this useful! Let us know what we can do to make it better, and we'll continue share it with others. If you have a request for a snippet to help you with repetitive tasks during TYPO3 extension development, let us know and we'll add it to the bundle and upload a new version.


comments

No comments yet. Be the first to comment on this!

Sorry, comments are closed for this post.