sirsid Posted yesterday at 04:59 PM Share Posted yesterday at 04:59 PM Hello, I'm building a forum type thing in PHP , js , css etc. At the mo It all runs on just 1 page which is ATM 1500 lines long. Is this too much ? Should I change this to1 page for each Link ? Or just leave it as is ? What do you all think ? Thank-You Sid Quote Link to comment https://forums.phpfreaks.com/topic/329952-page-size/ Share on other sites More sharing options...
Solution gizmola Posted 23 hours ago Solution Share Posted 23 hours ago Personally, I would have used an MVC framework so that I'd have separation of routing from Models/DAOs and Views/Templates/Markup. I'd most likely have some "services" and would be making use of quality component libraries whenever possible. Everything I create would be implemented in a way consistent with Dependency Injection, which would allow for use of a Dependency Injection Container. I prefer Symfony, so if it's my choice that is what I'd start with, which is going to dictate basic structure, and have a front controller pattern implementation. What you've done could be broken up into pieces and ported into an MVC framework, which would also help you see where you have reinvented the wheel, and you might also find that that framework has capabilities that could be handle some things you are doing in a more robust or elegant fashion. I also tend to make use of PHP Oop and if you do have classes stuffed inside your one giant script, then that's a dubious practice. While there is no fast rule on this, given PHP's page scope you are clearly having to load lots of unused code for every page request, but I don't want to overstate what currently even at 1500 lines of code, is not by any means overly large. Quote Link to comment https://forums.phpfreaks.com/topic/329952-page-size/#findComment-1657466 Share on other sites More sharing options...
sirsid Posted 5 hours ago Author Share Posted 5 hours ago Thank-You I think , I shall re-build , into many pages :~/ Might take me sometime :~? But what you have said makes sense :~) So Thank-You Best Regards Sid 1 Quote Link to comment https://forums.phpfreaks.com/topic/329952-page-size/#findComment-1657530 Share on other sites More sharing options...
gizmola Posted 2 hours ago Share Posted 2 hours ago If you have specific refactoring questions or want some advice, consider making new threads. The community here is full of experienced professional developers who are generous with their time and knowledge. 1 Quote Link to comment https://forums.phpfreaks.com/topic/329952-page-size/#findComment-1657538 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.