How to debug Dart in a PHP application

Hello,

I am working on a Laravel application on the server, with Dart in the browser.
When I try to set a breakpoint in PHPStorm, the browser (Dartium) does not break at this point.

Also when I edit /public/bones/web/quiz/quiz2.dart and click on the Dartium icon,
then Dartium is started on the page: mywebsite.com/public/bones/web/quiz/quiz2.dart.

It should open on mywebsite.com/botten/quiz2.
So how do I tell PHPStorm to open Dartium on this URL?

The same is true if I try to open the Laravel view where the Dart file is loaded.
The view file is /app/views/bones/quiz2.blade.php which should open at mywebsite.com/botten/quiz2.
So again: how do I tell PHPStorm which URL to open?


I'm sorry if this is a bit of a stupid question. I am just totally clueless.

Kind regards and thanks for any help,
Hendrik Jan

1 comment
Comment actions Permalink

Hi there,

IDE does not know and has no settings to make such complex conversions of the path, i.e. /app/views/bones/quiz2.blade.php --> mywebsite.com/botten/quiz2 ("normal" file path vs "nice" url). You cannot use "Open in browser" or similar actions as it will open the path as is (well ... it can add proper domain name and "eat" a folder or two (based on your Deployment configuration) .. but will not remove ".blade.php" part from opened url).

So again: how do I tell PHPStorm which URL to open?

I have never worked with dart .. but for PHP your option is to manually create Run/Debug configuration entry of correct type ("Run | Edit Configurations..." .. or via drop-down box on toolbar (next to Run/Debug buttons)

For PHP the most appropriate would be "PHP Web Application" -- there you can enter URL that needs to be opened.

I guess something similar would be for Dart as well.

Once created, you can use Run or Debug buttons to execute it.

P.S.
I usually open home page, then navigate to the page I need to debug .. and use Zero-Config approach (activating debugging session via bookmarklet or browser extension) to debug PHP app.

Webinar Recording: Debugging PHP with PhpStorm
https://confluence.jetbrains.com/display/WI/Getting+started+with+Dart

0

Please sign in to leave a comment.