M
M
Maxim Timofeev2016-07-27 13:58:40
Yii
Maxim Timofeev, 2016-07-27 13:58:40

How to make friends gii and php storm?

When generating code in gii, it is possible to copy it.
But when I copy-paste from a browser window in phpStorm, I get strange behavior:
all spaces are marked and when hovering over them, it writes Undefined constant, for example:
<?= $form->field($model, 'user_id') ?>
the first space - Undefined constant
 'user_id' - expression result unused
, etc.
Removing a space and inserting a new one from the clave - solves the issue. Apparently, when copying from the browser, the space character is not the same as the storm expects.
How to fix?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Koryukov, 2016-07-27
@MadridianFox

Why copy? Gii allows you to see what the result will be, but its main function is to generate files.

M
mitaichik, 2016-07-27
@mitaichik

I tried it - I don’t have such a problem, but:
Some programs put into the buffer not just text, but text with markup, so when pasting somewhere (including in phpStorm) it can turn out to be garbage + phpStorm can somehow reformat the pasted text.
To avoid this, there is a Paste Simple item in the phpStorm context menu - it inserts just text without markup and without formatting.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question