<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Sat, 18 May 2013 02:03:18 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[David M&uuml;ller: Cross Domain AJAX Guide]]></title>
      <guid>http://www.phpdeveloper.org/news/18868</guid>
      <link>http://www.phpdeveloper.org/news/18868</link>
      <description><![CDATA[<p>
In his latest post <i>David M&uuml;ller</i> covers some of the things to consider when <a href="http://www.d-mueller.de/blog/cross-domain-ajax-guide/">working with cross-domain ajax requests</a> including CORS and iframes.
</p>
<blockquote>
As it is widely known, AJAX Requests are only possible if port, protocol and domain of sender and receiver are equal. [...] Having this cleared out, we will cover ways around this restriction.
</blockquote>
<p>
He covers three main approaches to allowing these cross-domain requests (and some of the security implications that can come with them):
</p>
<ul>
<li>CORS (Cross Origin Resource Sharing)
<li>JSONP (Javascript with a local domain callback)
<li>Iframes
</ul>
<p>
He also briefly mentions things like <a href="https://developer.mozilla.org/en-US/docs/DOM/window.postMessage">window.postMessage</a> (HTML5) and the use of a backend script to proxy a request into your application's local code. 
</p>]]></description>
      <pubDate>Mon, 10 Dec 2012 12:17:39 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: PHP Ajax Cookbook (Book Review)]]></title>
      <guid>http://www.phpdeveloper.org/news/17829</guid>
      <link>http://www.phpdeveloper.org/news/17829</link>
      <description><![CDATA[<p>
On Dzone.com there's a book review from <i>Ivan Ilijasic</i> covering a recently released title from Packt Publishing, the "PHP Ajax Cookbook" (by Milan Sedliak, Rajesh Jeba R. Anbiah and Roshan Bhattarai). <a href="http://php.dzone.com/reviews/php-ajax-cookbook">His review</a> gives a "one minute bottom line" about the book and its contents.
</p>
<blockquote>
I've been in PHP development for more than 10 years and this book is really useful material. I could recommend it to beginners and experienced developers. From my point of view, there are three types of developer books - complete byte-to-byte fat books, introduction books and cookbooks. I want my cookbook to have useful and simple to use recipes. This book fulfilled my expectations.
</blockquote>
<p>
He mentions some of the topics that the book covers including javascript libraries and frameworks (mostly jQuery) and recipes for things like form validation, dynamic content, pagination and drag and drop functionality. He also points out some coverage of testing and debugging content as well as web service "mashups" and mobile app development.
</p>]]></description>
      <pubDate>Tue, 17 Apr 2012 13:03:50 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: Build Ajax Data Grids with CodeIgniter and jQuery]]></title>
      <guid>http://www.phpdeveloper.org/news/16901</guid>
      <link>http://www.phpdeveloper.org/news/16901</link>
      <description><![CDATA[<p>
In a new tutorial from NetTuts.com today they show you how to combine a <a href="http://codeigniter.com">CodeIgniter</a>-based backend and a <a href="http://jquery.com">jQuery</a> frontend to make a <a href="http://net.tutsplus.com/tutorials/javascript-ajax/build-ajax-data-grids-with-codeigniter-and-jquery-2/">simple Ajax data grid</a> of data pulled from a database.
</p>
<blockquote>
In this lesson, we will create a CodeIgniter library that allows us to generate data grids automatically for managing any database table. I'll explain each step required to create this class; so you'll likely learn some new OOP techniques/concepts in the process! As a bonus, we'll proceed to write some jQuery code that will enable a user to update the data grid's content without having to wait for a page refresh.
</blockquote>
<p>
The tutorial's broken up into a few different steps, each complete with descriptions and plenty of code ready for cut-and-paste:
</p>
<ul>
<li>Build a Data Grid Generator Class (a helper in PHP)
<li>Testing the Datagrid Helper Class with a CodeIgniter Controller
<li>Implementing Ajax (jQuery to the Rescue!)
<li>Check All or Nothing!
</ul>
<p>
You can also <a href="http://nettuts.s3.amazonaws.com/1053_ci_datagrid/CodeIgniter-datagrid-tutorial-source.rar">download the source</a> for all of the scripts if you'd like to dive right into the code.
</p>]]></description>
      <pubDate>Fri, 23 Sep 2011 12:23:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: How to Upload Files with CodeIgniter and AJAX]]></title>
      <guid>http://www.phpdeveloper.org/news/16847</guid>
      <link>http://www.phpdeveloper.org/news/16847</link>
      <description><![CDATA[<p>
New from NetTuts.com today there's a tutorial for those using the <a href="http://codeigniter.com">CodeIgniter</a> framework for their application. It shows how to <a href="http://net.tutsplus.com/tutorials/javascript-ajax/how-to-upload-files-with-codeigniter-and-ajax/">upload files with Ajax</a> and a simple form (with <a href="http://jquery.com">jQuery</a> and <a href="http://www.phpletter.com/Our-Projects/AjaxFileUpload/">AjaxFileUpload</a>).
</p>
<blockquote>
Uploading files asnychronously can be a pain at the best of times, but when coupled with CodeIgniter, it can be a particularly frustrating experience. I finally found a way that not only works consistently, but keeps to the MVC pattern.
</blockquote>
<p>
They help you create a database table to store the file information in (filename and title), make the controller to handle the request and build the view (with the form). Also included is the javascript you'll need to get the AjaxFileUpload script working for your file upload field. They extend the controller to handle the file upload and make a model to handle the upload and fetching of file information. The tutorial is finished off with a simple "delete" action to remove any file that's been uploaded.
</p>]]></description>
      <pubDate>Mon, 12 Sep 2011 12:03:27 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Tutorialzine.com: AJAX-enabled Sticky Notes With PHP & jQuery]]></title>
      <guid>http://www.phpdeveloper.org/news/16796</guid>
      <link>http://www.phpdeveloper.org/news/16796</link>
      <description><![CDATA[<p>
On the Tutorialzine.com site there's an interesting (though a bit older) tutorial showing you how to combine jQuery, PHP and some CSS+HTML to make a <a href="http://tutorialzine.com/2010/01/sticky-notes-ajax-php-jquery/">simple sticky note application</a> complete with multiple note support and drag-and-drop abilities.
</p>
<blockquote>
Today we are making an AJAX-enabled Sticky Note management system. It will give visitors the ability to create notes with a live preview, and move them around on the screen. Every movement is going to be sent to the back-end via AJAX and saved in the database.
</blockquote>
<p>
They use the <a href="http://fancybox.net/">fancybox plugin</a> for jQuery to make creating the notes a lot simpler. Included in the tutorial is all of the HTML, CSS, javascript and PHP you'll need to create the application (as well as plenty of description along the way). You can see a demo of it in action <a href="http://demo.tutorialzine.com/2010/01/sticky-notes-ajax-php-jquery/demo.php">here</a> or just <a href="http://demo.tutorialzine.com/2010/01/sticky-notes-ajax-php-jquery/demo.zip">download the source</a> and dive right in. 
</p>]]></description>
      <pubDate>Wed, 31 Aug 2011 10:16:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Joris de Wit's Blog: Extending different layouts for Ajax requests in Twig, Symfony2]]></title>
      <guid>http://www.phpdeveloper.org/news/16784</guid>
      <link>http://www.phpdeveloper.org/news/16784</link>
      <description><![CDATA[<p>
<i>Joris de Wit</i> has a (very) <a href="http://jorisdewit.ca/2011/08/27/extending-different-layouts-for-ajax-requests-in-twig-symfony2/">quick post</a> about a handy tip he found about switching layouts easily with <a href="http://twig-project.org">Twig</a> in his Symfony2-based application - a handy ternary sort of switch that can detect when something's an Ajax request.
</p>
<blockquote>
I just learned about the 'app' global variable in twig. It's very handy for loading a special layout for ajax requests.
</blockquote>
<p>
The "app" variable allows you get get back at some of the settings of your application and check on special things like the isXMLHttpRequest in his example. For more information about Twig and how you can add it to your application, check out <a href="http://www.twig-project.org/documentation">Twig-Project.org</a>. Using it's as simple as adding a phar.
</p>]]></description>
      <pubDate>Mon, 29 Aug 2011 11:39:34 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[David Stockton's Blog: Changing ErrorController to work with AJAX]]></title>
      <guid>http://www.phpdeveloper.org/news/16709</guid>
      <link>http://www.phpdeveloper.org/news/16709</link>
      <description><![CDATA[<p>
<i>David Stockton</i> has a new tutorial posted to his blog - a technique he's found useful in his Zend Framework application to make the <a href="http://zendtutorials.com/tutorial/changing-errorcontroller-to-work-with-ajax/">ErrorController work with Ajax calls</a> to reduce the message you get back to just a JSON response.
</p>
<blockquote>
If you've ever built a Zend Framework MVC app which makes AJAX calls, you may have noticed that if an error occurs, you'll get a chunk of JSON followed by the HTML for the error page. If you've built a layout, you'll get all of that back to. This is fine if your users hit the page in the browser but it can cause problems with your JavaScript being able to correctly decode your JSON.
</blockquote>
<p>
The fix is pretty simple, though, and only requires that you add the error handling action to the Ajax context to force it to drop the layout and any other HTML that might come along with the view. He includes a bit more code to have the error handler include the exceptions and pass them out to be included in the JSON response.
</p>]]></description>
      <pubDate>Fri, 12 Aug 2011 08:58:06 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Populating datagrid techniques with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16605</guid>
      <link>http://www.phpdeveloper.org/news/16605</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Gonzalo Ayuso</i> looks at the code required to <a href="http://gonzalo123.wordpress.com/2011/07/18/populating-datagrid-techniques-with-php/">populate a jQuery data grid</a> with the records as pulled from a (MySQL) database.
</p>
<blockquote>
Today I want to speak about populating datagrid techniques with PHP. At least in my daily work datagrids and tabular data are very common, because of that I want to show two different techniques when populating datagrids with data from our database. Maybe it's obvious, but I want to show the differences.
</blockquote>
<p>
He uses "old school spaghetti code" rather than a framework to keep things simple and pulls the data from the database with a PDO connection. This information is then manually pushed into an HTML table and the data grid functionality is applied to it. The other method involves a little bit of JSON magic that the data grid library pulls in and populates for you, still appending rows to a table. 
</p>
<p>
He notes that the second method seems faster to the user since the page and table are rendered first, but it also comes at the cost of more than one HTTP request.
</p>]]></description>
      <pubDate>Tue, 19 Jul 2011 09:25:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Shameer Chamal's Blog: Tutorial : Simple ajax validation for Kohana]]></title>
      <guid>http://www.phpdeveloper.org/news/16377</guid>
      <link>http://www.phpdeveloper.org/news/16377</link>
      <description><![CDATA[<p>
<i>Shameer Chamal</i> has a quick tutorial posted to his blog today showing how you can create a basic <a href="http://shameerc.com/2011/05/simple-ajax-validation-for-kohana.html">ajax validation feature</a> for your Kohana-based web application. 
</p>
<blockquote>
If you are new to Kohana framework, implementing validation will be an adventure, especially if you are looking for ajax validation. In this article I will present a simple way to implement some necessary validations using ajax in a sign up form. 
</blockquote>
<p>
He starts with a simple view containing the login form and including a few extra files (like the Javascript helper for the validation). Next he creates the user model that will do the backend check to see if the user already exists. Finally the controller and Javascript are created to bring all the pieces together. The Javascript uses the jQuery framework to make things a bit more convenient and runs a check against the backend for the given username with the response returned as a JSON message.
</p>]]></description>
      <pubDate>Tue, 24 May 2011 11:53:17 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Freeaqingme's Blog: PHP, JS & Service layers: Blend like never before]]></title>
      <guid>http://www.phpdeveloper.org/news/16061</guid>
      <link>http://www.phpdeveloper.org/news/16061</link>
      <description><![CDATA[<p>
On his Tweakblog today <i>Freeaqingme</i> has posted about some work he's done <a href="http://freeaqingme.tweakblogs.net/blog/6274/php-js-en-service-layers-blend-like-never-before.html">linking Javascript to a PHP service layer</a> and overcoming some of the performance issues he came across.
</p>
<blockquote>
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.
</blockquote>
<p>
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.
</p>]]></description>
      <pubDate>Thu, 17 Mar 2011 11:41:42 -0500</pubDate>
    </item>
  </channel>
</rss>
