Is there any way to highlight javascript syntax by eclipse (pdt) in a phtml file? Currently it only shows black text.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Problem is that phtml files are by default opened in the php editor, and that one doesn’t have javascript highlighting.
You could open your phtml file in the html editor or even the javascript editor (right-click the file from the navigator in eclipse, select “open with” and then the editor type you want (obviously you must have the html/js editor installed in eclipse but you most likely will have that). Then, of course, you loose the php highlighting. You can specify the other editor type as default in the settings (if you really want to).
The correct solution though is not to use javascript in your html (or phtml) files (or only the very bare minimum). Put it in a separate .js file, and syntax highlighting will work perfectly!