Reputation: 755
I miss 'for' live template in PhpStorm: for($i = 0 ; $i < 5 ; $i++){ ... }. - Has anybody managed to create an appropriate one? - Like 'fore' or 'forek' ? It's very strange, that unlike Intellij IDEA there is no such official live template in PhpStorm...
Upvotes: 2
Views: 338
Reputation: 31
Sorry for digging this up, but since I've stumpled upon it coming from google, other people might as well.
The template from OP is correct. For clarity, here with nice formatting and without the leading "int":
for($ITERABLE$ = 0; $ITERABLE$ < $LIMIT$; $ITERABLE$++) {
$END$
}
To get it to work, you have to define it as PHP template:
When defining the template in File > Settings > Live Templates, below the actual template text, there is red text: No applicable contexts yet.
Click on the blue "Change", set it to php and everything is fine.
Upvotes: 3