cakephp/cakephp — pull request #2932 by sam-at-github (2014-03-02 15:58:38+00:00)
Title: Minor Tidy up of RequestHandlerComponent around AJAX

Tried to make it more clear how AJAX is handled by doing as it consistently as possible with other types.

* Deprecates RequestHandler::$ajaxLayout, in favour of RequestHandler::$_viewLayoutMap array of mappings, not just one for AJAX. Had to add viewLayoutMap() "getter/setter" method, analogous to existing viewClassMap() method for this.
* Adds MIME mappping 'ajax' => 'text/html' in Response in order to remove some AJAX special casing in RequestHandler.
* Some test changed accordingly.
* Deleted one test.
* Comments.
* Also one liner fix to treat 'htm', and 'html' that same everywhere in there.

The deleted test deserves mention. There was a test. RequestHandlerComponent arbitrarily IMO mutated Controller's public 'ext' var which eventually gets stuffed into the instantiated View instance. I did not see any need to do that. RequestHandlerComponent was changing 'ext' back to its default in case someone changed it. If the user had bothered to actually change it they probably don't want that, and if they didn't its the same. (As an aside IMO the proper place to store view default settings is in the view classes not in the controller. Then RequestHandler could just switch the view class an be done with it. But that change turns out to be a little bit harder to make I think).