vs code formatting mixed php and html #3941
Replies: 3 comments 4 replies
-
You can run References: |
Beta Was this translation helpful? Give feedback.
-
Install PHP Extension: Ensure you have the PHP extension installed in VS Code. This extension provides PHP language support and formatting features. Configure Formatting Settings: Open your VS Code settings (press Ctrl + , or go to File > Preferences > Settings). You can also specify specific settings for HTML formatting within PHP files::
Use Prettier or Other Formatter: Consider using a code formatter like Prettier for consistent formatting across HTML and PHP code blocks. Prettier supports formatting both PHP and HTML code, ensuring uniform formatting styles. Ensure Proper Indentation: Make sure your PHP and HTML code blocks are properly indented to maintain readability. Proper indentation helps differentiate between PHP and HTML blocks and improves code organization. |
Beta Was this translation helpful? Give feedback.
-
Is there a way to do this? It's pretty annoying. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have set up formatting in vs code, and it works great for css and php when they are by themselves, the problem is when I mix PHP and HTML.
for example I want
on save, it will make it
I know I shouldn't mix the 2, but the PHP is just loops and conditional statements, so much easier to write as I am.
Any way to do this?
Beta Was this translation helpful? Give feedback.
All reactions