smudgie Posted January 19, 2014 Share Posted January 19, 2014 I'm confused! I'm reading up on the MVC approach. I've created a SPA using this approach but don't really understand what I'm doing as it was using a basic tutorial. I'm pretty sure what I produced was client-side for asynchronous updating using AJAX and JSON! So this would be the JavaScript Front end approach where frameworks like Angularjs and Backbone.js are used right??? However, when I read up about this it's all about using the SPA approach for a mobile application which I visualise for mobile app development rather than the web. If then I want to produce a website with DB interrogation, should I be looking at PHP MVC approaches that are server side and use frameworks like Codeigniter and Cakephp? Can someone please try and explain 'simply' which approach is the better for creating dynamic web content? I'm aware that there isn't a one size fits all approach but i need a starting point. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/285507-do-i-use-a-mvc-framework-for-dynamic-sites-or-apps/ Share on other sites More sharing options...
gristoi Posted January 20, 2014 Share Posted January 20, 2014 MVC is just a design pattern. If you want to use this pattern along with a single page app then you want to seperate the client from the server side completely. You want to look at using a RESTful approach to getting your data. So your server side can be any kind of framework ( or bespoke ) such as zend / symfony / laravel. The Model part of the server side will hold all of the business logic ( communicating with the db etc), the Controller will take the rest request -> speak to the model -> return the models data to the view, and in your case this would be in a JSON response. So technically no view. heres a good tutorial for doing it using laravel and backbone: http://net.tutsplus.com/tutorials/javascript-ajax/combining-laravel-4-and-backbone/ Quote Link to comment https://forums.phpfreaks.com/topic/285507-do-i-use-a-mvc-framework-for-dynamic-sites-or-apps/#findComment-1465864 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.