dougang1967
2014-05-08 16:28
浏览 53
已采纳

Aptana内容辅助,DOMDocument PHP

I have something like:

$elements = $document->query(...);
foreach ($elements as $element) {
    $element -> //I want content assist
}

But Aptana (Studio 3, build: 3.5.0.201401092130) is not giving me the content assist. if I do something like

$e = new DOMNode();
$e -> //content assist 

then I'm getting the content assist.

How can I get it to work on the $element in the foreach?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dosc9472 2014-05-08 16:43
    已采纳

    I'm not an Aptana user but most decent IDEs allow type hinting with this syntax:

    foreach ($elements as $element) {
        /* @var $element DOMNode */
        $element -> //I want content assist
    }
    

    ... or, some times, this variation:

    foreach ($elements as $element) {
        /* @var DOMNode $element  */
        $element -> //I want content assist
    }
    
    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题