当前位置: 首页>>代码示例>>PHP>>正文


PHP sfRequest::isXmlHttpRequest方法代码示例

本文整理汇总了PHP中sfRequest::isXmlHttpRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP sfRequest::isXmlHttpRequest方法的具体用法?PHP sfRequest::isXmlHttpRequest怎么用?PHP sfRequest::isXmlHttpRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sfRequest的用法示例。


在下文中一共展示了sfRequest::isXmlHttpRequest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _redirectError

 /**
  * Redirect process for a failed login
  *
  * @param   sfRequest $request
  * @param   sfUser    $user
  * @return  mixed
  */
 protected function _redirectError($request, $user)
 {
     if ($request->isXmlHttpRequest()) {
         $this->getResponse()->setHeaderOnly(true);
         $this->getResponse()->setStatusCode(401);
         return sfView::NONE;
     }
     // if we have been forwarded, then the referer is the current URL
     // if not, this is the referer of the current request
     $user->setReferer($this->getContext()->getActionStack()->getSize() > 1 ? $request->getUri() : $request->getReferer());
     $this->redirect(sfConfig::get('sf_login_module') . '/' . sfConfig::get('sf_login_action'));
 }
开发者ID:kevindew,项目名称:sfFacebookGraphPlugin,代码行数:19,代码来源:BasesfFacebookGraphAuthActions.class.php

示例2: executeSortProfileOption

 /**
  * Executes sortProfileOption action
  *
  * @param sfRequest $request A request object
  */
 public function executeSortProfileOption($request)
 {
     if ($request->isXmlHttpRequest()) {
         $request->checkCSRFProtection();
         $parameters = $request->getParameterHolder();
         $keys = $parameters->getNames();
         foreach ($keys as $key) {
             if (preg_match('/^profile_options_\\d+$/', $key, $match)) {
                 $order = $parameters->get($match[0]);
                 for ($i = 0; $i < count($order); $i++) {
                     $profileOption = Doctrine::getTable('ProfileOption')->find($order[$i]);
                     if ($profileOption) {
                         $profileOption->setSortOrder($i * 10);
                         $profileOption->save();
                     }
                 }
                 break;
             }
         }
     }
     return sfView::NONE;
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:27,代码来源:actions.class.php

示例3: executeLoadUserData

 /**
  * Загрузить данные пользователя, AJAX
  */
 public function executeLoadUserData(sfRequest $request)
 {
     $this->forward404Unless($request->isXmlHttpRequest());
     $result = array();
     // будем возвращать
     $user = $this->getUser()->getUserRecord();
     $subscribtion = Doctrine::getTable('ServiceSubscription')->getActiveUserServiceSubscription($user, Service::SERVICE_SMS);
     # Svel:
     #       а не лучше ли мапить это во вью?
     $result['profile'] = array('login' => $user->getUserLogin(), 'name' => $user->getUserName(), 'mail' => $user->getUserMail(), 'timezone' => $user->getTimeZone(), 'integration' => array('email' => str_replace('@mail.easyfinance.ru', '', $user->getUserServiceMail())), 'reminders' => array('enabled' => is_object($subscribtion) ? 1 : 0, 'mailEnabled' => $user->getReminderMailDefaultEnabled(), 'mailDaysBefore' => $user->getReminderMailDays(), 'mailHour' => $user->getReminderMailHour(), 'mailMinutes' => $user->getReminderMailMinutes(), 'smsPhone' => $user->getSmsPhone(), 'smsEnabled' => $user->getReminderSmsDefaultEnabled(), 'smsDaysBefore' => $user->getReminderSmsDays(), 'smsHour' => $user->getReminderSmsHour(), 'smsMinutes' => $user->getReminderSmsMinutes()));
     $this->getResponse()->setHttpHeader('Content-Type', 'application/json; charset=utf-8');
     return $this->renderText(json_encode($result));
 }
开发者ID:ru-easyfinance,项目名称:EasyFinance,代码行数:16,代码来源:actions.class.php


注:本文中的sfRequest::isXmlHttpRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。