genericnumber1 Posted January 22, 2007 Share Posted January 22, 2007 A website where individual pages are classes implementing a controller interface. index.php creates the instance of the page controller class depending upon a get variable and calls a common method defined by the controller interface.vsDoing the pages the classic way with the logic embedded on them individually.Any opinions? I can never decide between these, the first has some advantages over the second but can be pretty overkill at times, am I thinking too Java? Quote Link to comment Share on other sites More sharing options...
bqallover Posted January 23, 2007 Share Posted January 23, 2007 I generally use the second form, and have header.php, footer.php and maybe other "output includes" if the project requires them.There's no [i]real[/i] problem with first form, though as you say it can be a little overkill sometimes. Unless you're using a database to store the content (and hence bordering on the CMS/blog scale of things), you'll probably have separate files anyway for each page so there's no [i]real[/i] advantage to my mind.In practice, I've done a number of sites where I use [url=http://www.pivotlog.net]Pivot[/url] as either a blog or news engine (i.e. the second form) and embed that on one page of a more traditional site (i.e. the first form). So as in most things, combining the two is often a good approach. ;) Quote Link to comment Share on other sites More sharing options...
redbullmarky Posted January 23, 2007 Share Posted January 23, 2007 i actually use the first method, based on trials with frameworks such as Cake and CodeIgniter. Once you get used to it, you'll find things much easier to maintain and use in the future than doing things the classic way. Quote Link to comment Share on other sites More sharing options...
genericnumber1 Posted January 23, 2007 Author Share Posted January 23, 2007 Yeah, I'll probably stick with the MVC pattern for large applications, but I'll probably just go with the classic way for the small apps or if performance is a real issue. Thanks for the info Quote Link to comment 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.