當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ResponseFactory::make方法代碼示例

本文整理匯總了PHP中Illuminate\Routing\ResponseFactory::make方法的典型用法代碼示例。如果您正苦於以下問題:PHP ResponseFactory::make方法的具體用法?PHP ResponseFactory::make怎麽用?PHP ResponseFactory::make使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Illuminate\Routing\ResponseFactory的用法示例。


在下文中一共展示了ResponseFactory::make方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: make

 /**
  * Make the response.
  *
  * @param FileInterface $file
  * @return Response
  */
 public function make(FileInterface $file)
 {
     // Start the response.
     $response = $this->response->make();
     $response->headers->set('Etag', $file->etag());
     $response->headers->set('Content-Type', $file->getMimetype());
     $response->headers->set('Last-Modified', $file->lastModified()->setTimezone('GMT')->format('D, d M Y H:i:s'));
     $response->setTtl(3600);
     return $response;
 }
開發者ID:ramcda,項目名稱:files-module,代碼行數:16,代碼來源:FileResponse.php

示例2: make

 /**
  * Make the response.
  *
  * @param FileInterface $file
  * @return Response
  */
 public function make(FileInterface $file)
 {
     // Start the response.
     $response = $this->response->make();
     $response->headers->set('Pragma', 'public');
     $response->headers->set('Etag', $file->hash());
     $response->headers->set('Content-Length', $file->getSize());
     $response->headers->set('Content-Type', $file->getMimetype());
     $response->headers->set('Cache-Control', 'public,max-age=300,s-maxage=900');
     // Should be configurable
     $response->headers->set('Last-Modified', $file->lastModified()->setTimezone('GMT')->format('D, d M Y H:i:s'));
     return $response;
 }
開發者ID:bloveless,項目名稱:files-module,代碼行數:19,代碼來源:FileResponse.php

示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  * @return mixed
  */
 public function handle(Request $request, Closure $next)
 {
     if ($this->guard->guest()) {
         if ($request->ajax()) {
             return $this->response->make('Unauthorized.', 401);
         } else {
             if ($request->segment(1) === 'admin') {
                 return $this->redirect->guest('admin/login');
             } else {
                 return $this->redirect->guest('login');
             }
         }
     }
     return $next($request);
 }
開發者ID:jacksun101,項目名稱:users-module,代碼行數:22,代碼來源:Authenticate.php

示例4: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  * @return mixed
  */
 public function handle(Request $request, Closure $next)
 {
     $response = $this->security->check($this->guard->user());
     if ($response instanceof Response) {
         return $response;
     }
     if ($this->guard->guest()) {
         if ($request->ajax()) {
             return $this->response->make('Unauthorized.', 401);
         } else {
             if ($request->segment(1) === 'admin') {
                 return $this->redirect->guest('admin/login');
             } else {
                 return $this->redirect->guest('login');
             }
         }
     }
     return $next($request);
 }
開發者ID:AkibaTech,項目名稱:users-module,代碼行數:26,代碼來源:Authenticate.php

示例5: make

 /**
  * Return a new response from the application.
  *
  * @param string $content
  * @param int $status
  * @param array $headers
  * @return \Illuminate\Http\Response 
  * @static 
  */
 public static function make($content = '', $status = 200, $headers = array())
 {
     return \Illuminate\Routing\ResponseFactory::make($content, $status, $headers);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:13,代碼來源:_ide_helper.php


注:本文中的Illuminate\Routing\ResponseFactory::make方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。