NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Autocompletion with Zend Framework


Joined: 29 Aug 2007
Posts: 39
Reply with quote
I'm trying to remember if / how I can specify to PhpEd what a particular object is an instance of for the purpose of showing the correct autocomplete details.

For example, if I am working with Zend Framework view (.phtml) files, I have access to $this (being an instance of Zend_View) without having to create the instance in the file. Because of this, PhpEd doesn't know what the object is and can therefore not explore the object and offer the autocomplete. I think I read somewhere on here you can put in a comment in a format that PhpEd uses to identify objects.

Or did I just dream that?

Also, does PhpEd have the ability to autocomplete chained object functions .... like would it autocomplete and give type hints for 'execute()' in the following ?

$object->function()->execute();


Thanks
View user's profileFind all posts by StryksSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
That would be by using PhpDOC
Code:
/** @var Zend_View */
$this ->


Think it will work for $this too
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 29 Aug 2007
Posts: 39
Reply with quote
Ahhhh .... excellent stuff. Many thanks.

Do you know if it's possible to get autocomplete on chained functions?
View user's profileFind all posts by StryksSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
It is as long as PhpED is able to figure out what the return types are. Be sure to add a PhpDoc block before each function specifying that and the parameters (if you want info on those too). Linky.
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Autocompletion with Zend Framework
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic