how can i find which source file defines a specific class

by user1104799   Last Updated April 15, 2018 18:10 PM - source

Does anyone have any tips on how to quickly find the file that would contain the class definition of class in Joomla?

I often find myself wanting to look up the definition of an object to be sure that I know how it is defined, or to learn more about what it does and I would prefer to be able to quickly look through the source code on my wamp development folder.

For example, I am looking at an older component I wrote and want to remind myself what

JHtml::_('formbehavior.chosen, select')


In this case I ended up searching through the 'libraries' directory for a string 'function _(' until I found the right file. I have a feeling that this isn't the most efficient way to find the definition code! :)

I've tried using the site but that doesn't see to point me back to the correct file in my installation (and I couldn't see how to easily search the api index, or how to view the source code)

Many thanks in advance ! ps. I also posted this on the Joomla forum, so apologies if you see it twice!

Tags : joomla-3.x

Answers 1

Use a decent IDE. For example, with PhpStorm, place the cursor on the method name (_ in this case), and press Ctrl-B. The IDE finds and opens the corresponding file and scrolls to the method.

I'm sure that other IDEs provide a similar function. Tooling is important in the end, if you want to be efficient.

April 15, 2018 21:34 PM

Related Questions