2009年11月23日 星期一

Small hint for PDT, use autocomplete in /* @var */type hint.

@var variable type hint is very useful, but adding it a little bit complex: usually you need to type the class name or copy/paste it from somewhere:

/* @var $controller Zend_Controller_Front */

But with Eclipse PDT templates you can simplify this and add an autocomplete for variable name and class name:



To add this template open Window menu, select Preferences and then navigate to PHP/Templates section in the tree. Then click "New..." button and fill the fields correspondingly:



After that, in the code view type "var" and press Ctrl+Space. Select "var - Variable type hint" in the list and continue by selecting or typing variable name and class name as shown on the video below:



摘自:http://www.alexatnet.com/node/179

沒有留言:

wibiya widget