Ace: PHP highlighting without the opening PHP tag

Created on 11 Jun 2015  路  2Comments  路  Source: ajaxorg/ace

I know that this is now how PHP files actual work in the wild, but would it be possible to allow for the ace editor to provide syntax highlighting when in PHP mode even if I don't physically write <?php at the start of the editor? I looked through the documentation briefly but didn't find anything in reference to this as a feature. I'd like to give my users the ability to just start writing PHP without requiring them to include the opening tag so maybe adding an option on the PHP editor that will allow for this?

Most helpful comment

Yes you can. You need to set inline to true.
session.setMode({path:"ace/mode/php", inline:true})

All 2 comments

Yes you can. You need to set inline to true.
session.setMode({path:"ace/mode/php", inline:true})

Awesome! Thanks @baconface - works great!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xfix picture xfix  路  5Comments

featurecat picture featurecat  路  4Comments

akosyakov picture akosyakov  路  3Comments

ketysek picture ketysek  路  3Comments

christianbs picture christianbs  路  3Comments