r/PHPhelp • u/satailx • Jun 12 '25
Solved PHP Code Editor
(PHP code editor that grays out HTML when working with PHP and vice versa)
Greetings! (And sorry if the question is misplaced)
Couple of years ago I saw a code editor that grayed out all HTML blocks when working with PHP code blocks and grayed out PHP code blocks when working with HTML. Switching happened automatically: when text cursor was put in the PHP code all HTML code was grayed out, focusing on PHP, and when cursor was put in HTML code, all PHP code was grayed out, focusing on HTML.
Unfortunately, I forgot what that editor was and cannot find it now. Can anyone advise its name?
------------------
UPD: PHPDesigner has this feature (thanks to u/LordAmras). However, if you know any other editor with this feature, please, feel free to add.
View all comments
Show parent comment
1
u/LordAmras Jun 13 '25
Templating system don't have to be complex nor do they need MVC, there are very simple templating systems like mustache (which I'm partial to, because I really like to not have logic into the visualisation) that have basically no logic to them and fit your case of full html page with small server side stuff.
But even if you want to use a full templating system like Twig is not very much code to do, you do composer install and you write your html in the tpl file and your logic in the php file.
At the end of the php file you just do new Templating, load tpl file, and render passing the variables.
All templates system will work basically like this.
You can write the Javascript in a script block and the css in a style block, but if you write it in a. css and a . js file and load them separately is much cleaner, simpler to maintain and for almost no effort.