G
G
grabbee2019-06-09 07:49:08
IDE
grabbee, 2019-06-09 07:49:08

How to set up `if` autocompletion in PhpStorm?

IF block substitution does not work for me as described in the documentation
https://www.jetbrains.com/help/phpstorm/auto-compl...

PhpStorm automatically completes the construct and adds the required punctuation, and the caret is placed at the next editing position.

Instead of this
ps_completing_code_construct_2.png
Only: `if ()` - no brackets ;(
I would like to have a full template

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2019-06-09
@grabbee

if ($PARAM$) {
   $END$
}

prntscr.com/nzg9m5
If I understand correctly

D
Dmitry, 2019-06-09
@slo_nik

Good morning.
In PHPStorm 2018.3, such a thing works.
Enter such a construction and press Enter As a result, you get

if ($a) {
    
}

Enter this and press Enter . As a result, you get the following
if ($a>=0) {
    
}

For everything to work, the cursor must be at the end of the input line.
More details can be found in Settings->Editor->General->Postfix Completion->PHP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question