Man, I’m drowning in `<?php ?>` tags and the code is looking tragic. Trying to stick to vanilla PHP without a framework, but it’s getting messy real quick. How do you guys keep your views readable?
I'm with you on the spaghetti code, I started using PHP-HTML separation with templates like Blade or Twig, works like a charm. It's a bit of a learning curve at first but definitely worth it for maintainability. If you're just starting out, might wanna check those out.
I feel you, I've been there too. To be honest, I switched to Twig templating engine for my PHP projects, it's a game changer - separate concerns, clean code, and easy to maintain. It also helps you keep your PHP code out of your HTML templates.
Yeah, I feel your pain with PHP spaghetti. I've been using Composer and PSR-2 to keep my PHP organized, it makes it way easier to work with. I'd also recommend looking into Blade templating for a cleaner separation of presentation and logic.
Yeah, I feel ya, my code used to be a mess too till I discovered PHP include files and functions. Now I just focus on one task per file, keeps everything clean and easy to maintain. Give that a shot and let me know how it works out for you.
I'm using a templating engine like Twig to keep my PHP separate from the HTML, makes the code way more manageable. You can also try using a MVC framework like Laravel, it helps to organize your code into different files and folders. I made the switch a few months ago and it's been a total game changer for my project's structure.
Honestly, grab a template engine like Twig or Blade ASAP. Mixing raw logic with your tags is a total nightmare, so keep them separate if you want to save your sanity.
Bro, keep all the heavy logic at the very top of the file and only echo variables in the HTML. You really gotta separate the controller logic from the view or that spaghetti will never end.