当前位置:Gxlcms > PHP教程 > zf判断请求是否来自XMLHttpRequest对象的方法

zf判断请求是否来自XMLHttpRequest对象的方法

时间:2021-07-01 10:21:17 帮助过:21人阅读

  1. /*
  2. * * Is the request a Javascript XMLHttpRequest?
  3. * * Should work with Prototype/Script.aculo.us, possibly others.
  4. * * @return boolean
  5. */
  6. public function isXmlHttpRequest() {
  7. return (
  8. $this->getHeader('X_REQUESTED_WITH') == 'XMLHttpRequest');
  9. }

人气教程排行