Search code examples
javascriptjquerysymfony1phpstormnavigator

PhpStorm and JavaScript: list of functions in code embedded in PHP


Recently I've been trying to switch from Netbeans to PhpStorm (3.0.3, latest version) and there's only one thing that is holding me back.

My current project, written in Symfony 1.4, has A LOT of JavaScript (jQuery) in Symfony templates (PHP files). Netbeans is kind enough to list JS functions and variables in a navigator window, but I don't see a similar behavior in PhpStorm. Does PhpStorm have this kind of feature? If so, how do I turn it on?


EDIT: OK, I see there's some confusion. Lets say I have a PHP file called TEST.php. Inside that file I have the following:

<script type="text/javascript">
    $.myPluginContainer.definitions.TEST = {
        var1: someVar1,
        var2: someVar2,
        var3: someVar3,

        function1: function() {
            // function1 body
            return 'function1';
        },
        function2: function() {
            // function2 body
            return null;
        },
        function3: function() {
            // function3 body
            return 5;
        }
    }
</script>

In Netbeans' Navigator window I get:

Navigator window in Netbeans 7.1

Double-clicking on the function name in Netbeans takes me to that particular variable/function definition. PhpStorm has the same, only in pure *.js files, but I need this behaviour with *.php files too.


Solution

  • I have just found that the "Structure" tab down the left hand side of the screen will show you the equivalent of the NetBeans/Eclipse Function Navigator view.

    I am using JetBrains PhpStorm 6.0.3