Syntax Error Editor

Once an error handler has been registered, when a syntax error occurs, you can not only display the error but make a fix in the browser on the fly. The browser is then automatically reloaded for you upon save. This feature can really minimize the time and frustration caused by simple careless mistakes.

(new\BEAR\Ace\ErrorEditor)->registerSyntaxErrorEdit();

edit();

You can also view file content in the editor by using the edit function. Just specify the object or file path in the argument.

$file=__DIR__.'file.php';edit($file);

$a=newA;edit($a);

xdebug.file_link_format

The online editor can be linked to in the stack trace file name using the following ini configuration of xdebug.

xdebug.file_link_format=localhost:8090/?file=%f&line=$l

Syntax Error Integration in Symfony2

1) Add "bear / ace" to composer.json, then install it with the composer command.

"require": {..."bear/ace": "*" },

$ composer update bear/ace

2) Register a syntax error editor in web/app_dev.php.

require_once__DIR__.'/../app/AppKernel.php';// after this line(new\BEAR\Ace\ErrorEditor)->registerSyntaxErrorEdit();// before this line$kernel=newAppKernel('dev', true);