Note that there are some explanatory texts on larger screens.

plurals
  1. POSymfony2 framework.ide setting on Windows
    primarykey
    data
    text
    <p>I am currently trying to learn Symfony2 and trying to set it up. There is a framework.ide setting within Symfony2 that allows for opening the controller and action in your IDE.</p> <p>I am currently using PhpStorm together with Remote Call. I have figured out how to get this working on a Linux environment, however, in Windows this doesn't want to work due to Windows using backwards slashes (which JavaScript seems to escape).</p> <p>My current config looks like this:<br> <strong>config_dev.yml</strong></p> <pre><code>framework: ide: 'javascript: var r = new XMLHttpRequest; r.open("get", "http://localhost:8091?message=%%f:%%l");r.send()' </code></pre> <p>This makes the debugger's action name link to:</p> <pre><code>javascript: var r = new XMLHttpRequest; r.open("get", "http://localhost:8091?message=C:\Users\Hosh\vhosts\symfony\src\Acme\DemoBundle\Controller\WelcomeController.php:9");r.send() </code></pre> <p>Which is nice and all, however, JavaScript seems to see the file path as:</p> <pre><code>javascript: var r = new XMLHttpRequest; r.open("get", "http://localhost:8091?message=C:UsersUservhostssymfonysrcAcmeDemoBundleControllerWelcomeController.php:9");r.send() </code></pre> <p>My current solution is by overriding the template <code>WebProfileBundle:Collector:request.html.twig</code> and manually running the link through a replace filter so that:</p> <pre><code> 7. &lt;span class="sf-toolbar-info-class sf-toolbar-info-with-next-pointer"&gt;{{ collector.controller.class|abbr_class }}&lt;/span&gt; 8. &lt;span class="sf-toolbar-info-method" onclick="{% if link %}window.location='{{link}}';window.event.stopPropagation();return false;{% endif %}"&gt; 9. {{ collector.controller.method }} 10. &lt;/span&gt; </code></pre> <p>becomes:</p> <pre><code> 7. &lt;span class="sf-toolbar-info-class sf-toolbar-info-with-next-pointer"&gt;{{ collector.controller.class|abbr_class }}&lt;/span&gt; 8. &lt;span class="sf-toolbar-info-method" onclick="{% if link %}{{ link|replace({'\\': '/'}) }}{% endif %}"&gt; 9. {{ collector.controller.method }} 10. &lt;/span&gt; </code></pre> <p>Is there any better solution to this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload