6 June 2009
@see snippet for TextMate
I’ve been doing a ton of work with the newest Zend Framework version 1.8.2 this weekend. At BKWLD, we’ve standardized on ZF for many of our sites and it’s also the base of our super-fancy BKWLD Unified CMS, so it behooves me to keep up with the latest hotness.
Since we are also always improving our standards and practices when it comes to coding and documentation, we’ve been using PHPDoc and ASDoc to create documentation for our code. I’ve found that typing out all the requires for each class can be a pain in php, so I made a quick TextMate snippet to make adding @see directives for phpdoc at the same time as the require_once directive. Here it is; simple but useful:
/**
* @see $1
*/
require_once "${1/_/\//g}.php";$0
Add this as a “Tab Trigger” for the word “see” then just type “see” and hit tab then type your class name. It will auto fill the comment and the path to the pear-conventionally-named .php file.
Got any other useful TextMate snippets? Using something cool to document your code? Please do share!