sasori Posted July 8, 2011 Share Posted July 8, 2011 Hello, I built a system using a framework called Yii, now I was asked to re-write everything from scratch without a framework. I don't know how to do a system architecture, I'm used to do coding rightaway controllers,models with the help of an existing php framework w/o minding system design/folder structures., can you guys give me some tips how to do such? or a templating engine such as smarty can do the job for me ? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/241379-php-application-structure/ Share on other sites More sharing options...
btherl Posted July 8, 2011 Share Posted July 8, 2011 Why were you asked to re-write it without a framework? I would just go ahead and copy the framework's structure. Smarty is just a templating engine, not a framework or a structure, although it can form part of one. Honestly the best approach is to find a framework you like and use that, but if you were specifically asked not to use an existing framework, then I would instead find a framework you like and copy how it works. The structure we use is more or less MVC, with a small controller sending requests off to various files that implement a particular page, and they send requests off to classes that do most of the work. Those pages then return an array to smarty which renders the template. Quote Link to comment https://forums.phpfreaks.com/topic/241379-php-application-structure/#findComment-1239931 Share on other sites More sharing options...
sasori Posted July 8, 2011 Author Share Posted July 8, 2011 because a 3rd party module made up of spaghetti and some oop coding style will be integrated in the system and i think it'll cause a huge impact in most of my code or if not, i will have to tweak the third party stuff to fin in the framework that i use..that's why they asked me to re-write everything without a framework..they worry about having a limitation of hiring someone who doesn't know the framework that i use.. Quote Link to comment https://forums.phpfreaks.com/topic/241379-php-application-structure/#findComment-1239932 Share on other sites More sharing options...
xyph Posted July 8, 2011 Share Posted July 8, 2011 Learning a framework is easier than sifting through someone else's code :/ Do they plan to hire someone capable of building a framework but can't use one?! Quote Link to comment https://forums.phpfreaks.com/topic/241379-php-application-structure/#findComment-1239933 Share on other sites More sharing options...
sasori Posted July 8, 2011 Author Share Posted July 8, 2011 Learning a framework is easier than sifting through someone else's code :/ Do they plan to hire someone capable of building a framework but can't use one?! I already explained that the other devs they have are cool and better than me and they can learn the framework that I use in a short period of time.. but , you know, am not the boss so I lost the debate battle Quote Link to comment https://forums.phpfreaks.com/topic/241379-php-application-structure/#findComment-1239936 Share on other sites More sharing options...
xyph Posted July 8, 2011 Share Posted July 8, 2011 My favourite phrase: You hired me to do this, so let me do it the right way Quote Link to comment https://forums.phpfreaks.com/topic/241379-php-application-structure/#findComment-1239937 Share on other sites More sharing options...
btherl Posted July 8, 2011 Share Posted July 8, 2011 Fair enough.. if your boss asks you to re-invent the wheel then you have to re-invent the wheel. And the best way is to look at an existing wheel and more or less copy it. Googling "PHP MVC tutorial" turns up quite a number of tutorials, so that's another possible angle to start with. I'm a bit reluctant to give advice at this stage - I would find it much easier if you started writing the framework and posted back here when you got stuck. One tip - if you're going to be integrating with 3rd party spaghetti code, I would seriously consider using namespaces to insulate your code from the spaghetti. Unless the spaghetti happens to have clearly defined boundaries in how it deals with the global namespace. Quote Link to comment https://forums.phpfreaks.com/topic/241379-php-application-structure/#findComment-1239944 Share on other sites More sharing options...
sasori Posted July 8, 2011 Author Share Posted July 8, 2011 Fair enough.. if your boss asks you to re-invent the wheel then you have to re-invent the wheel. And the best way is to look at an existing wheel and more or less copy it. Googling "PHP MVC tutorial" turns up quite a number of tutorials, so that's another possible angle to start with. I'm a bit reluctant to give advice at this stage - I would find it much easier if you started writing the framework and posted back here when you got stuck. One tip - if you're going to be integrating with 3rd party spaghetti code, I would seriously consider using namespaces to insulate your code from the spaghetti. Unless the spaghetti happens to have clearly defined boundaries in how it deals with the global namespace. I see, php5.3 namespaces..thanks for the extra tips Quote Link to comment https://forums.phpfreaks.com/topic/241379-php-application-structure/#findComment-1239945 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.