I'm wondering if there's some way to write javadoc comments in an included/required PHP file such that I can assign datatypes to variables defined outside that document so that I get all the cool autocompletion features for my classes.
I ask this because of the way CodeIgniter loads its views. You define controllers to handle user requests and these have methods which load views:
// a controller method
public function mycont() {
// blah blah do some stuff
// define an array of data to send to the view
$data = array(
"var1" => "i am var one",
"var2" => "I am var 2"
"var3" => $someCrazyObject
);
$this->load->view("myview", $data); // loads myview.php
}
then, within myview.php the array keys are instantiated as variables in the local scope:
// myview.php
echo $var1; // outputs i am var one
echo $var2; // outputs i am var2
Sadly, when I open myview.php in PDT, Eclipse doesn't know that $var3 is an instance of the class SomeCrazyObject so I don't get the amazing eclipse code completion features and so on. Is there some way to declare a javadoc comment for $var3 without altering its value?