Kuf
Kuf

Reputation: 17828

Backbone.js and codeIgniter

I'm using the codeigniter Framework to use my servers side logic, and I want to use backbonejs to manage the client side logic.

I read a lot about it and there are many ways to achieve this, I thought using the following design:

What is the best way to use them both? Does my design breaks the MVC design somehow?

Upvotes: 0

Views: 1446

Answers (1)

Ingro
Ingro

Reputation: 2841

Premise: I use Yii instead of CI but I think they work in a similar way.

I have a index view in Yii which contains the main HTML structure of my app (menu, sidebar, main content, etc.) and a main controller which manage the REST requests, using Yii's model to retrieve information.

On the client Backbone take care of all, each route fire a request to the REST-like api and the views are finally rendered by the client with the data returned from the server in JSON format.

I don't know if this is the better way, but after some struggling I get it to work and I'm quite happy about it.

Upvotes: 2

Related Questions