Type Hint for view scripts |
Site Admin
|
May I ask you to post more or less complete example? Perhaps a kind of trivial case with two files would be enough.
Regarding $this, it's almost never requires type-hints because its type is current class and it's always known (unless I don't understand what's going on). Regarding $this->page, you may want to add type hint to the place where "page" property is declared. In this case all references to page will be recognized properly. |
||||||||||||
_________________ The PHP IDE team |
|
A view script is a plain php script that is included by a method of a class.
Basically like this:
and /some/path/to/template.phtml like:
So when editing the template PhpED can not know of what type $this is or which properties it has. So I need type hinting. KASI |
||||||||||||||||
|
Site Admin
|
What I should say... This kind of code is not supported. If possible, please don't include files into a class method or function.
Otherwise, you have to provide typehint for $this too. |
||||||||||||
_________________ The PHP IDE team |
|
This is the way Zend Framework's MVC works (or can work) - the view file is a separate phtml file which is basically a Zend_View instance (Zend/OO purists will correct me here no doubt - hey I used to code in 68000, all this OO stuff isn't my bag)
It would be a great help if there was a way of explicitly typing a whole file to a particular class, perhaps a preference where you could say that a .phtml is essentially a Zend_View class (link it with the class file). Sorry I think that was really badly explained! |
||||||||||||
|
Type Hint for view scripts |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by