If you’ve ever used the Backbone framework for JavaScript, you’ll already be familiar with Underscore. Indeed, it’s become incredibly useful for JavaScript developers in general. But did you know that it’s been ported to PHP?
In this article I’ll take a look at Underscore, what it can do, and provide some examples of where it might be useful.
What is Underscore?
Underscore describes itself as a “utility belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects. It’s the tie to go along with jQuery’s tux, and Backbone.js’s suspenders.”
Most notably, Underscore provides a bunch of utilities for working with collections and arrays, some for working with objects, basic templating functionality and a number of other useful functions.
The functions which operate on collections and arrays can be particularly useful when dealing with JSON, which makes it great for handling responses from web services.
Continue reading %Getting Started with PHP Underscore%
more
{ 0 comments... » Getting Started with PHP Underscore read them below or add one }
Post a Comment