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


PHP Response::getTargetUrl方法代码示例

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


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

示例1: logResponse

 /**
  * Logs a response
  *
  * @param Response $response
  */
 protected function logResponse(Response $response)
 {
     if ($response instanceof RedirectResponse) {
         $this->logger->info('< ' . $response->getStatusCode() . ' ' . $response->getTargetUrl());
     } else {
         $this->logger->info('< ' . $response->getStatusCode());
     }
 }
开发者ID:hafedhbou,项目名称:hetic-p2017,代码行数:13,代码来源:LogListener.php

示例2: logResponse

 /**
  * Logs a response.
  *
  * @param Response $response
  */
 protected function logResponse(Response $response)
 {
     $response->headers->set('trace-token', TracingRequest::getInstance()->getTraceId());
     if ($response instanceof RedirectResponse) {
         $this->logger->info('< ' . $response->getStatusCode() . ' ' . $response->getTargetUrl());
     } else {
         $this->logger->info('HTTP response: ' . $response->getStatusCode() . ' #TRACE#{"event":"response.send"}');
     }
 }
开发者ID:samkeen,项目名称:export-demo-companion,代码行数:14,代码来源:TracingEventListener.php

示例3: logResponse

 /**
  * @param \Symfony\Component\HttpFoundation\Response $response
  *
  * @return void
  */
 protected function logResponse(Response $response)
 {
     if ($response instanceof RedirectResponse) {
         $message = sprintf('%s Response %s [%s], target URL %s', $this->getSapi(), APPLICATION, $response->getStatusCode(), $response->getTargetUrl());
     } else {
         $message = sprintf('%s Response %s [%s]', $this->getSapi(), APPLICATION, $response->getStatusCode());
     }
     $this->logger->info($message, ['response' => $response]);
 }
开发者ID:spryker,项目名称:Application,代码行数:14,代码来源:KernelLogListener.php

示例4: collect

 /**
  * {@inheritdoc}
  */
 public function collect(Request $request, Response $response, \Exception $exception = null)
 {
     if ($response instanceof RedirectResponse) {
         $this->data['redirect'] = true;
         $this->data['url'] = $response->getTargetUrl();
         if ($this->controllers->contains($request)) {
             $this->data['route'] = $this->guessRoute($request, $this->controllers[$request]);
         }
     }
 }
开发者ID:joan16v,项目名称:symfony2_test,代码行数:13,代码来源:RouterDataCollector.php

示例5: collect

 /**
  * {@inheritdoc}
  */
 public function collect(Request $request, Response $response, \Exception $exception = null)
 {
     if ($response instanceof RedirectResponse) {
         $this->data['redirect'] = true;
         $this->data['url'] = $response->getTargetUrl();
         if ($this->controllers->contains($request)) {
             $controller = $this->controllers[$request];
             if (is_array($controller)) {
                 $controller = $controller[0];
             }
             if ($controller instanceof RedirectController) {
                 $this->data['route'] = $request->attributes->get('_route', 'n/a');
             }
         }
     }
 }
开发者ID:laubosslink,项目名称:lab,代码行数:19,代码来源:RouterDataCollector.php

示例6: logResponse

 /**
  * Logs a response.
  *
  * @param Response $response
  */
 protected function logResponse(Response $response)
 {
     $message = '< ' . $response->getStatusCode();
     if ($response instanceof RedirectResponse) {
         $message .= ' ' . $response->getTargetUrl();
     }
     $this->logger->log(LogLevel::DEBUG, $message);
 }
开发者ID:opensourcerefinery,项目名称:vicus,代码行数:13,代码来源:LogListener.php


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