is there any way I can use Zend only for server process?. I want to have all my client process in javascript and the server process in php using Zend framework or any other framework. Any ideas are welcome.
-
1In general, it is possible, but what exactly are you trying to do?Ofir– Ofir2011-09-12 05:41:40 +00:00Commented Sep 12, 2011 at 5:41
-
What I am trying to do is to have all my views (forms) in html-css-javascript classic way and all the server process in php using zend as a framework.Also, I want to know if is mandatory to use zend_forms when you use the zend framework.Nicklaus– Nicklaus2011-09-12 14:44:30 +00:00Commented Sep 12, 2011 at 14:44
2 Answers
Zend is a component library that let you do php on the server side - So yes! you can use it to handle all your clients' process. BTW, it's a good practice to leverage ZendFramework MVC so you will start with great concept/project structure etc'. Good luck!
1 Comment
The answer is: of course!
ZF is a server-side framework. It's completely agnostic about it's output format. You'll find you have no problem outputting json, or xml, or whatever format you like.
While it's typical to have your application output HTML pages via Zend_View/Zend_Layout, there are other components available to facilitate sending non-HTML output..
If you're doing a fancy javascript-driven client, you might consider going the RESTful route with Zend_Rest_Route, and/or Zend_Rest_Controller.
In your comment, you mention concern about Zend_Form. You're free to ignore Zend_Form -- though you might want to reconsider. It's quite possible to leverage the filtering/validation functionality of Zend_Form (define a form, and just use populate(), isValid(), etc) without ever rendering a form. I did a project not long ago that was a single-page app using ExtJS on the client side, which which talked to a set of RESTful services in JSON provided by ZF. I used Zend_Form extensively just for filtering/validating data.