PHP instead <?php and php> {PHP} and {/PHP}
-
I really have trouble to find out the following:
I would like the exact same Language for php, but since I use a speacial programm, I need
{PHP} and {/PHP}
instead of
<?php and php>can someone create an xml for this please?
(I can’t find the xml for php that I can build it on.) -
I can’t find the xml for php that I can build it on
The built-in lexers (like PHP) are separate from the User Defined Language lexing , so there is no such creature to find – there is no way to start a UDL based on the settings for a built-in lexer.
You either need to code a new lexer or lexer plugin, or update the PHP lexer coding and recompile, or create a new UDL from scratch. The last option seems your best choice, though because UDL isn’t as powerful as a true built-in or plugin lexer, you’ll probably be somewhat disappointed in the results.
-
Thank you!
do you know if there already is a php based UDL that I can modify slightly with this beginning {PHP} and ending {/PHP}?
i have trouble finding it here:
github com/notepad-plus-plus/userDefinedLanguages/blob/master/UDLs/Geomatica_EASI_byPhilippeCote.xml (missing 1 rep to send links)compiling new sounds pretty hard for a newby like me.
-
@sunshinebard said in PHP instead <?php and php> {PHP} and {/PHP}:
do you know if there already is a php based UDL that I can modify slightly with this beginning {PHP} and ending {/PHP}?
i have trouble finding it here:The User Defined Language (UDL) collection does not appear to have a PHP UDL. Most of the time, people don’t bother creating a UDL for a language that Notepad++ handles natively, unless they find something that doesn’t quite meet their needs. (But given how few are published to replace existing lexers, I think they also discover that the limitations of UDL outweigh the missing aspects of the built-in lexer, so don’t bother sharing it. And most of the ones that do exist were actually made before Notepad++ added native support for that language.)
(missing 1 rep to send links)
I’ve upvoted you now, so that limitation is gone.
compiling new sounds pretty hard for a newby like me.
Well, yes, compiling it yourself isn’t for the faint of heart. I was trying to steer you toward making your own UDL, because making a simple UDL is actually really easy: just put a few keywords in the “Define Your Language” dialog.
If you do create a UDL for PHP, or for your modified PHP, feel free to share it in the Collection.
But really, if the only difference in your language is that it uses
{PHP}and{/PHP}, you could probably just use the EnhanceAnyLexer plugin to enhance the PHP-lexer to highlight0x123456 = {/?PHP}(where 0x123456 is the 0xGGBBRR color code you want to use for that.) -
@PeterJones
I installed it. do you know how I can achieve that screenshot 1 will look like screenshot 2
just coloring it won’t work I’m afraid

btw: thank you very much for your help so far!
-
I’m afraid that doesn’t seem to be possible, as
<seems to be a critical part for the php/html/xml lexer.
It looks like you need to create a UDL yourself. -
@Ekopalypse
Thank you for your help! what a pitty. (right now it is easier to just copy the code in between the working <php …)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login