本文整理匯總了PHP中type::getResponse方法的典型用法代碼示例。如果您正苦於以下問題:PHP type::getResponse方法的具體用法?PHP type::getResponse怎麽用?PHP type::getResponse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類type
的用法示例。
在下文中一共展示了type::getResponse方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: formNotAuthResponse
/**
* ответ об ошибке и редирект
* @param type $e
* @return type
*/
private function formNotAuthResponse($e)
{
$url = $e->getRouter()->assemble(array(), array('name' => 'users/default'));
$response = $e->getResponse();
$response->getHeaders()->addHeaderLine('Location', $url);
$response->setStatusCode(302);
$response->sendHeaders();
return $response;
}
示例2: testAccessIsDeniedForUnauthorized
/**
*
* @dataProvider getSecuredPagesAuthenticated
* @param type $client
* @param type $url
*/
public function testAccessIsDeniedForUnauthorized($client, $url)
{
$client->request('GET', $url);
$this->assertEquals(403, $client->getResponse()->getStatusCode());
}
示例3: onRequestSent
/**
* Query has received a result, stop the query.
*/
public function onRequestSent(Event $event)
{
$stopTime = microtime(TRUE);
$this->time = round(($stopTime - $this->startTime) * 1000, 2);
$this->response = $this->request->getResponse();
}
示例4: getResponse
/**
*
* @param type $method
* @param type $uri
* @return type
* @throws InvalidStatusCodeException
*/
protected function getResponse($method, $uri)
{
if ($this->responseStatusCode != NULL) {
$_responseStatusCode = $this->responseStatusCode;
if ($method->getResponse($this->responseStatusCode) != NULL) {
$this->responseStatusCode = NULL;
return $method->getResponse($_responseStatusCode);
}
throw new InvalidStatusCodeException($this->responseStatusCode, $uri, $method->getType());
}
foreach ($this->statusCodes as $statusCode) {
$response = $method->getResponse($statusCode);
if ($response != NULL) {
return $response;
}
}
if (sizeof($method->getResponses()) > 0) {
$responses = $method->getResponses();
return $responses[key($responses)];
}
throw new NoResponseFoundException($uri, $method->getType());
}