编程语言
首页 > 编程语言> > 如何在PhpStorm 9中为Blade模板自动完成变量?

如何在PhpStorm 9中为Blade模板自动完成变量?

作者:互联网

我想在刀片模板中考虑PHPdoc块.

PhpStorm 9,Laravel 5.1,刀片模板文件:

<?php
/* @var App\Models\User $user */
?>
...
<?= $user->email ?> <- autocomplete for the word "email" is working
...
{{ $user->email }} <- autocomplete not working

我尝试了不同的变种:

{{
/**
* @var App\Models\User $user
**/
}}
{{ /* @var App\Models\User $user */ }}
...
{{ $user->email }} <- autocomplete not working...
...
In such variant autocomplete works, but only within that block:
{{
/* @var App\Models\User $user */
$user->email
}}
...
{{ $user->email }} <- here does not work again...

如何在刀片模板的所有块中使用自动完成功能?

解决方法:

ATM PhpStorm不支持​​使用刀片语法的刀片模板中的PHPDoc注释(特别是对于完成刀片变量).

请按照这些门票(星级/投票/评论)获得进展通知:

> https://youtrack.jetbrains.com/issue/WI-26501
> https://youtrack.jetbrains.com/issue/WI-25287

标签:php,laravel,blade,phpstorm,phpdoc
来源: https://codeday.me/bug/20191006/1858117.html