Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good, lightweight non-mvc php framework for backbone.js web application [closed]

I'm developing a JS web application with requirejs, backbone.js, underscore.js and jquery.
At work my backend is a jboss application server.
My views are templates (static html files) that are served by the tomcat part of jboss and integrated into the frontend by underscore.js templating.
So I don't need to generate any VIEW at the server side.
Except for the aforementioned static file provision by tomcat (html and js files), I need the jboss backend only for data retrieval (session beans that get the data via jpa from the database and return it as json).
Now I also want to start a web application at home in my spare time.
In the frontend area I will use the same library stack, but in the backend I want to use php.
Php at the backend is cheap, you can easily find a good, low priced php+mysql provider.
On the backend I search for a solution which is generally similar to my work environment: I want php only to give me the model part, only the data from the database. All other parts (view templates, js files) come from the apache static file service.
And I want a lightweight php framework which helps me to achieve that (NO MVC). I already invested pretty much time in finding a solution, but was not really successful.
I've been working with the zend framework for quite a while:
I know that this framework can be used in an non-mvc way. I've written some examples that only use it in this manner. But I'm not satisfied with zend. It's too big and slow form me.

My question is to the backbone.js web application developers that have a php backend:

What backend solution are you using to get the models and collections from the server. Which experiences did you have with it?

UPDATE:
Thank you, for your answers.
I now found a promising microframework project called "slimphp".

like image 552
Wolfgang Adamec Avatar asked Feb 24 '12 22:02

Wolfgang Adamec


People also ask

What is PHP MVC framework?

What is PHP MVC framework? PHP MVC is an application design pattern that separates the application data and business logic (model) from the presentation (view). MVC stands for Model, View & Controller. The controller mediates between the models and views. Think of the MVC design pattern as a car and the driver.

Is Backbone JS Frontend or Backend?

Backend Synchronization BackboneJS is use with the front-end and back-end systems, allows the synchronization with the backend to provide support to RESTful APIs.


1 Answers

It sounds like you're looking for a microframework; something lightweight that provides the features you're looking for without getting in the way.

One microframework with which I'm familiar is Silex, which is built on some of the same components used by the Symfony2 framework. I'm not entirely sure what all your caveat of "no MVC" covers, but it's simple enough to create an API that interacts with your database and handles/provides JSON to be used with backbone, skipping over templating and other nonessentials (from your app's standpoint) entirely.

Silex ships with a provider for the Doctrine Database Abstraction Layer (documentation here), which will handle your database interactions, and there's a cookbook tutorial for accepting a JSON request body, so that accepting JSON data in a post, for example, is handled easily by the framework.

like image 78
Derek Stobbe Avatar answered Sep 28 '22 19:09

Derek Stobbe