lcobucci/action-mapper — pull request #1 by drgomesp (2012-01-09 19:11:52+00:00)
Title: Added support to ajax request verification and single parameters

Two methods added:

/**
* Checks if the request was made by ajax by looking for the
* "X_Requested_With" header sent by most javascript frameworks,
* like jQuery, Prototype and ExtJS.
*
* @return boolean
*/
public function isAjax() { ... }

/**
* Return a request specific parameter. If the parameter is NULL,
* the $defaultValue will be returned.
*
* @param string $key The parameter to return
* @param mixed $defaultValue The default value to be returned in case of NULL param
* @return string
*/
public function getParam($param, $defaultValue = NULL) { ... }

These tho methods provide nice solutions for common problems, such as creating ajax-only routed actions and returning individual parameters of the request.