我已经找到了解决方案,但我找不到任何适合的Twig,我知道这是一种生活品质.但它会使模板稍微容易一些.
例
{% for userObj in userObjCollection %}
{{ userObj.property }}
{# I want to type hint userObj so I can use intellisense to get the right property #}
{% endfor %}
Run Code Online (Sandbox Code Playgroud)
我目前正在使用PHPStorm IDE,
非常感谢任何建议或指示.
编辑 请注意,这是一个简单的问题,可以更简单地在循环中进行编码.不是网站用户会接触到的东西.(还添加了phpstorm标签来澄清)
编辑2
我已经安装了Symfony2和PHP Annotations插件(很抱歉没有提前指出这个)