2
在我的控制器我有這樣的代碼:如何在包含的PHP文件中註釋變量?
public function showStudent($id)
{
$student = new Student();
$student->loadFromId($id);
/* call the view */
include '/path/to/student/view.php';
}
在view.php文件我希望我的代碼編輯器(NetBeans中,當然)知道$學生是學生類的一個實例,因此可以建議檢查的方法和屬性等我能幫編輯與註釋知道這一點,像
<?php
/**
* @magic Student $student
*/
?>
<html>
....
<p>Good day, <?= $student->name; ?></p>
</html>
對不起,不適合我。根據ApiGen docs @var有兩個參數:數據類型和描述,並且應該在變量聲明之前。我不想重新聲明變量 –
請確保您以'/ *'而不是'/ **'開頭。應該管用。 – adlawson
沒有骰子。也許它是崇高的具體? –