News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Freeaqingme's Blog:
PHP, JS & Service layers Blend like never before
March 17, 2011 @ 11:41:42

On his Tweakblog today Freeaqingme has posted about some work he's done linking Javascript to a PHP service layer and overcoming some of the performance issues he came across.

The past week I've been only programming (clientside) Javascript, and last night I finally got to tying it all to the serverside app, which is written in PHP. While adding some functionality to my Service Layer, it came to mind how much slower this process was in the past. [...] One of the nice things of Service Layers and performing your Access Control there, is that you can have multiple points of entry. So, to lessen the amount of tediousness, one can simply use one controller for all service requests coming from the client.

He was connecting to two via a XMLHttpRequest to a custom URL that would return a different result based on the kind of request. Internal routing handled the request correctly and the result from the view was pushed directly back to the client. He includes code to illustrate - a bit of PHP based on the Zend Framework structure, the Javascript to make the request and an example of invoking the service on the client side.

0 comments voice your opinion now!
javascrupt tutorial servicelayer ajax xmlhttprequest


blog comments powered by Disqus

Similar Posts

Mihai Corlan's Blog: Flex for PHP developers

SaniSoft Blog: Introduction to creating desktop applications with PHP and Titanium

PHPMaster.com: Patterns for Flexible View Handling, Part 2 - Using Decorators

SitePoint PHP Blog: HHVM and Hack - Can We Expect Them to Replace PHP?

Daniel Krook's Blog: NYPHP Conference & Expo 2006


Community Events





Don't see your event here?
Let us know!


tips laravel podcast install opinion series framework library package voicesoftheelephpant deployment symfony release language introduction api bugfix interview list community

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework