[Solar-talk] isXml

Rodrigo Moraes rodrigo.moraes at gmail.com
Thu Jan 18 16:00:22 PST 2007


On 10/19/06, Paul M Jones wrote:
> This is a recent development, but you can check $this->_request->isXml
> () to see if the "X-Requested-With" header is "XmlHttpRequest".  Easy
> AJAX recognition; thank Clay for having that idea.  :-)

isXml is a very nice idea (thanks, Clay), and I found it so useful
that I have set a $is_xml public property in my app so I have a short
way to check it in views.

However, I always feel that the name is strange (when I use isXml I
think in XML itself, and not in XMLHttpRequest). Rail uses
request.xhr, so I was thinking if isXhr wouldn't be more appropriate
and easy to recognize. Just an idea, though, and not very important of
course. :-)

rodrigo


More information about the solar-talk mailing list