Replies: 4 comments 3 replies
-
Removing the php sections may be a bit tricky to do. but it is possible to enable live preview of php files as HTML, but that will display all the php text in the live preview as you mentioned. |
Beta Was this translation helpful? Give feedback.
-
Thank you. Maybe this is not the way to do things, but all my PHP are embedded in a single large <?php> section at the beginning of the file for readability, and I tought that you could add a rule just to ignore that. I understand that others may sprinkle php code here and there and that it would be a headache to remove, but I thought a single section would be easy. |
Beta Was this translation helpful? Give feedback.
-
Thanks for checking out Phoenix Code and glad that it has made life Easier. Handling single PHP blocks in the way described isn't as straightforward as it may seem. The issue with adding a special rule to ignore a single large <?php> block is that if we create an exception for one case, it sets an expectation that all PHP code, no matter how it's structured, would be treated similarly. From the editor's perspective, we need to ensure consistent and predictable behavior in every situation. If we introduced a feature that only works in some cases (like with a single PHP block), it could lead to confusion when things break. Users might not be sure if the issue lies in their code or if the editor is handling the PHP incorrectly. One of our core goals with Phoenix Code is to provide rock-solid reliability so you can trust that when something isn’t working, it's likely due to your code, not the editor. Implementing partial solutions or hacks could compromise that trust and lead to a poor user experience. We have a tacking feature request to enable advanced PHP code intelligence and live previews in the future. So all these are likely to be addressed when we start on that. That may not come in the next 4 months though. If you have any other suggestions or encounter any issues, please don't hesitate to reach out. |
Beta Was this translation helpful? Give feedback.
-
Hi there, Thanks for your help. Here is the code the issue is in line 14. prepare($query); $stmt->execute(['name' => $name]); header("Location: index.php"); exit(); } ?>(here) <title>Add Equipment</title>Add EquipmentEquipment Name: Add Equipment |
Beta Was this translation helpful? Give feedback.
-
Would it be possible to allow the preview of a PHP file that contains valid HTML too?
I usually have a mixture of PHP and HTML in my files, and I don't care so much to be able to run the PHP but I would like to be able to render the HTML - and ignore any of the PHP code. Right now, if I rename the PHP file .html, some of the PHP is interpreted as HTML, and if I keep the PHP extension, the preview altogether does not work.
Beta Was this translation helpful? Give feedback.
All reactions