News Feed
Sections




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

SitePoint PHP Blog:
Getting Started with PHP Underscore
April 17, 2014 @ 13:50:28

The SitePoint PHP blog has a new article posted showing you how to get started with Underscore, a PHP library ported over from Javascript's popular Underscore.js library with many of the same methods intact.

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? [...] 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."

He starts by showing you how to get it installed and some of the basic syntax of the methods it defines (basically replace the period with the double-colon) for both the procedural and OOP handling. He shows examples of a few of the more handy methods it provides including:

  • Each
  • Pluck
  • Minimum and Maximum
  • Filter and Reject
  • sortBy
  • groupBy

...and many more. There's also a bit of talk about templating and extending the library via "mixins".

0 comments voice your opinion now!
underscore port introduction methods functionality

Link: http://www.sitepoint.com/getting-started-php-underscore/

blog comments powered by Disqus

Similar Posts

Ilia Alshanetsky's Blog: FUDforum 2.7.6RC1 Released

Pierre-Alain Joye's Blog: Finally some new features are coming, zip-1.9.0 serie began

Ilia Alshanetsky\'s Blog: PHP Quebec Recap

SitePoint.com: Sneak Peek at Kevin Yank's New Book 'PHP & MYSQL: Novice to Ninja'

PHPit.net: An introduction to XML-RPC in PHP


Community Events





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


interview series wordpress project introduction laravel library threedevsandamaybe podcast developer api application configure framework community bugfix language code list release

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