Opening and closing PHP tags faster in templates

In Zend Studio when you are outside of a PHP block and type "<?" (and nothing more, it works immediately after typing the "?") it gets converted to "<?php ?>" (and with the cursor before the second "?").
This is really really useful when you are writting your templates views.

Is possible to do the same with PHPStorm?

Thanks !

4 comments
Comment actions Permalink

Hi Enrique,

There is no built-in functionality to do exactly that. But you can use Live Templates (Settings | Live Templates) to implement this -- create one so when you type <?[TAB], it will be replaced by <?php ?>. (By [TAB] I mean pressing Tab key or whatever other "expand" button you have chosen). Works fine for me -- no issues at all:

Abbreviation: <?
Description: Whatever you like
Template text: <?php $END$ ?>
Applicable in: PHP

0
Comment actions Permalink

Thanks Andriy !
I've choosen the <?[SPACE]

0
Comment actions Permalink

Enrique,

Please submit a feature request for your case - http://youtrack.jetbrains.com/dashboard#newissue=yes

Thank you for feedback!

0

Please sign in to leave a comment.