Link to home
Start Free TrialLog in
Avatar of wantime
wantime

asked on

PHP5 / Zend: mouse click, then jump into related source codes

hi all,

it is about developing php5/Zend project under Netbeans.

i usually click on the code by using right mouse "Navigate->Go to Declaration" to see the related source codes. It works fine when i do this in .php file.

the problem i met is:  "Navigate->Go to Declaration"  doesn't work in .phtml file. For instance, i have code in .phtml file like:

$this->cycle()->next();

as i use  "Navigate->Go to Declaration"  on these codes, nothing happened.

Are there any way to find out the Declaration of the codes in .phtml file? (in this case, i would find out what $this, cycle(), next() related to.  I know that one can get it out by using debugger, but is it possible by using mouse click with  "Navigate->Go to Declaration" ?)

thanks,
wantime
Avatar of ollyatstithians
ollyatstithians
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi,
I am not familiar with Netbeans specifically, but have you checked that your library code (ie. Zend Framework) is included in the IDE?
I think it is in Tools>Options>General tab.
Correction:
Add your Zend Framework "library" directory to the list in:
Tools>Options>PHP>General
Avatar of wantime
wantime

ASKER

thanks.

the library code is there like you said.

"Navigate->Go to Declaration"   works in *.php files, but it doesn't work in *.phtml. Is it normal or not?

I have checked on Netbeans, and you are right.
I think it may be due to a difference between objects explicitly created and those created by factory methods (ie. the IDE can't find the declaration because it does not really exist in the code). It may also be due to the use of overloaded methods (__get() and __set()). I have experienced this before using Eclipse PDT.
I am not sure what you can do about it, other than just browse through the library manually for that class and method. On the up side, your view scripts should be simpler anyway.
Not the best answer i'm afraid. :(
Avatar of wantime

ASKER

are there anyother IDE to do this?
I think most IDEs will hit this problem. Eclipse PDT certainly does.
You could try Zend Studio, as they may have enhanced its ability to deal with ZF, but it is expensive. There is a free demo though.
Here is a bug report from Netbeans which pretty much sums it up:

http://netbeans.org/bugzilla/show_bug.cgi?id=190861

There is an apparent workaround at in the last post, but if you can figure out how to make it work, let me know. :(
ASKER CERTIFIED SOLUTION
Avatar of ollyatstithians
ollyatstithians
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial