Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

good php framework for fully ajax-based web applications? [closed]

i'm developing a web application that focus heavily on ajax. the whole application is just on one page except for the threads that are in traditional pages so they can be indexed.

so i have to have very structured JS-codes and i wonder if they are any frameworks out there that are for ajax-based applications.

eg. codeigniter, cakephp and others i have read about dont focus on this. they just organize regular php code according to mvc.

cause my code starts to be very messy (especially the js code) and i really need some structure here. is there a way to have same mvc + oop structure in javascript? i never heard anyone talking about it. even if i put js codes in separate files, one for each page for example, there are a lot of lines and i feel lost and crunch whenever i have to add some new functionalities.

would be great with suggestions and ideas how to structure this up!

like image 347
ajsie Avatar asked Feb 01 '10 19:02

ajsie


People also ask

How PHP can be used in an AJAX application?

Create an XMLHttpRequest object. Create the function to be executed when the server response is ready. Send the request off to a PHP file (gethint. php) on the server.

Is AJAX a PHP framework?

It is an open source framework written in PHP, used to develop/create/generate AJAX applications. The fundamental idea behind AJAX (Asynchronous Javascript and XML) is to use the XMLHttpRequest object to change a web page state using background HTTP subrequests without reloading the entire page.

Which PHP framework is fast?

CodeIgniter also has the reputation for being the fastest PHP framework for web development. If a web app revolves around data management, CodeIgniter is the best PHP framework as well. Using CodeIgniter, it is easy to create, insert, update, and delete coding statements without writing raw SQL.


2 Answers

I think you have the wrong mindset about this.

AJAX-heavy sites or applications aren't that much different form their Web 1.0 counterparts in their underpinnings. You still have the same basic components: HTTP Requests and responses. It's just that with AJAX you rarely request a full HTML page. Most of the time you're requesting snippets of HTML, XML, or JSON.

So, just because you'll have a web site/app that is 90%+ AJAX driven doesn't mean you need to throw away existing conventions like MVC and look for something new.

And most modern frameworks have plenty of AJAX stuff baked in: ZF, symfony, cake, etc.

EDIT

I don't know of any framework, PHP or JavaScript, geared towards what you are asking. That being said, you might get something out of watching High-performance JavaScript: Why Everything You've Been Taught Is Wrong, Designing the Rich Web Experience, and High Performance Ajax Applications, even though they're a couple years old now.

Also, consider digging into projects that are AJAX heavy and seeing how they tick. ExtJS and jQuery UI based applications would be a good start.

like image 167
Peter Bailey Avatar answered Oct 20 '22 00:10

Peter Bailey


You might check out Zephyr. Never used it myself, I just know that it's mainly for AJAX apps.

like image 34
Mike Crittenden Avatar answered Oct 20 '22 00:10

Mike Crittenden