Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationLatte
      • ApplicationTracy
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsLatte
      • Framework
      • HttpTracy
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Templating
    • Utils
  • NetteModule
  • none
  • Tracy

Classes

  • Context
  • FileUpload
  • Helpers
  • Request
  • RequestFactory
  • Response
  • Session
  • SessionSection
  • Url
  • UrlScript
  • UserStorage

Interfaces

  • IRequest
  • IResponse
  • ISessionStorage
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Other releases
  • Nette homepage

Class Response

HttpResponse class.

Nette\Object
Extended by Nette\Http\Response implements Nette\Http\IResponse
Namespace: Nette\Http
Author: David Grudl
Located at Http/Response.php
Methods summary
public
# __construct( )
public Nette\Http\Response
# setCode( integer $code )

Sets HTTP response code.

Sets HTTP response code.

Parameters

$code
integer

Returns

Nette\Http\Response

Throws

Nette\InvalidArgumentException
if code is invalid
Nette\InvalidStateException
if HTTP headers have been sent

Implementation of

Nette\Http\IResponse::setCode()
public integer
# getCode( )

Returns HTTP response code.

Returns HTTP response code.

Returns

integer

Implementation of

Nette\Http\IResponse::getCode()
public Nette\Http\Response
# setHeader( string $name, string $value )

Sends a HTTP header and replaces a previous one.

Sends a HTTP header and replaces a previous one.

Parameters

$name
string
header name
$value
string
header value

Returns

Nette\Http\Response

Throws

Nette\InvalidStateException
if HTTP headers have been sent

Implementation of

Nette\Http\IResponse::setHeader()
public Nette\Http\Response
# addHeader( string $name, string $value )

Adds HTTP header.

Adds HTTP header.

Parameters

$name
string
header name
$value
string
header value

Returns

Nette\Http\Response

Throws

Nette\InvalidStateException
if HTTP headers have been sent

Implementation of

Nette\Http\IResponse::addHeader()
public Nette\Http\Response
# setContentType( string $type, string $charset = NULL )

Sends a Content-type HTTP header.

Sends a Content-type HTTP header.

Parameters

$type
string
mime-type
$charset
string
charset

Returns

Nette\Http\Response

Throws

Nette\InvalidStateException
if HTTP headers have been sent

Implementation of

Nette\Http\IResponse::setContentType()
public
# redirect( string $url, integer $code = Nette\Http\IResponse::S302_FOUND )

Redirects to a new URL. Note: call exit() after it.

Redirects to a new URL. Note: call exit() after it.

Parameters

$url
string
URL
$code
integer
HTTP code

Throws

Nette\InvalidStateException
if HTTP headers have been sent

Implementation of

Nette\Http\IResponse::redirect()
public Nette\Http\Response
# setExpiration( string|integer|DateTime $time )

Sets the number of seconds before a page cached on a browser expires.

Sets the number of seconds before a page cached on a browser expires.

Parameters

$time
string|integer|DateTime
time, value 0 means "until the browser is closed"

Returns

Nette\Http\Response

Throws

Nette\InvalidStateException
if HTTP headers have been sent

Implementation of

Nette\Http\IResponse::setExpiration()
public boolean
# isSent( )

Checks if headers have been sent.

Checks if headers have been sent.

Returns

boolean

Implementation of

Nette\Http\IResponse::isSent()
public mixed
# getHeader( string $header, mixed $default = NULL )

Returns value of an HTTP header.

Returns value of an HTTP header.

Parameters

$header
string
$default
mixed

Returns

mixed
public array
# getHeaders( )

Returns a list of headers to sent.

Returns a list of headers to sent.

Returns

array
(name => value)

Implementation of

Nette\Http\IResponse::getHeaders()
public static string
# date( string|integer|Nette\Utils\DateTime $time = NULL )

Returns HTTP valid date format.

Returns HTTP valid date format.

Parameters

$time
string|integer|Nette\Utils\DateTime

Returns

string
public
# __destruct( )
public Nette\Http\Response
# setCookie( string $name, string $value, string|integer|DateTime $time, string $path = NULL, string $domain = NULL, boolean $secure = NULL, boolean $httpOnly = NULL )

Sends a cookie.

Sends a cookie.

Parameters

$name
string
name of the cookie
$value
string
value
$time
string|integer|DateTime
expiration time, value 0 means "until the browser is closed"
$path
string
$domain
string
$secure
boolean
$httpOnly
boolean

Returns

Nette\Http\Response

Throws

Nette\InvalidStateException
if HTTP headers have been sent

Implementation of

Nette\Http\IResponse::setCookie()
public
# deleteCookie( string $name, string $path = NULL, string $domain = NULL, boolean $secure = NULL )

Deletes a cookie.

Deletes a cookie.

Parameters

$name
string
name of the cookie.
$path
string
$domain
string
$secure
boolean

Throws

Nette\InvalidStateException
if HTTP headers have been sent

Implementation of

Nette\Http\IResponse::deleteCookie()
Methods inherited from Nette\Object
__call(), __callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants inherited from Nette\Http\IResponse
BROWSER, PERMANENT, S100_CONTINUE, S101_SWITCHING_PROTOCOLS, S200_OK, S201_CREATED, S202_ACCEPTED, S203_NON_AUTHORITATIVE_INFORMATION, S204_NO_CONTENT, S205_RESET_CONTENT, S206_PARTIAL_CONTENT, S300_MULTIPLE_CHOICES, S301_MOVED_PERMANENTLY, S302_FOUND, S303_POST_GET, S303_SEE_OTHER, S304_NOT_MODIFIED, S305_USE_PROXY, S307_TEMPORARY_REDIRECT, S400_BAD_REQUEST, S401_UNAUTHORIZED, S402_PAYMENT_REQUIRED, S403_FORBIDDEN, S404_NOT_FOUND, S405_METHOD_NOT_ALLOWED, S406_NOT_ACCEPTABLE, S407_PROXY_AUTHENTICATION_REQUIRED, S408_REQUEST_TIMEOUT, S409_CONFLICT, S410_GONE, S411_LENGTH_REQUIRED, S412_PRECONDITION_FAILED, S413_REQUEST_ENTITY_TOO_LARGE, S414_REQUEST_URI_TOO_LONG, S415_UNSUPPORTED_MEDIA_TYPE, S416_REQUESTED_RANGE_NOT_SATISFIABLE, S417_EXPECTATION_FAILED, S426_UPGRADE_REQUIRED, S500_INTERNAL_SERVER_ERROR, S501_NOT_IMPLEMENTED, S502_BAD_GATEWAY, S503_SERVICE_UNAVAILABLE, S504_GATEWAY_TIMEOUT, S505_HTTP_VERSION_NOT_SUPPORTED
Properties summary
public string $cookieDomain ''
#

The domain in which the cookie will be available

The domain in which the cookie will be available

public string $cookiePath '/'
#

The path in which the cookie will be available

The path in which the cookie will be available

public string $cookieSecure FALSE
#

Whether the cookie is available only through HTTPS

Whether the cookie is available only through HTTPS

public string $cookieHttpOnly TRUE
#

Whether the cookie is hidden from client-side

Whether the cookie is hidden from client-side

public boolean $warnOnBuffer TRUE
#

Whether warn on possible problem with data in output buffer

Whether warn on possible problem with data in output buffer

Magic properties inherited from Nette\Object
$reflection
Nette 2.2 API documentation generated by ApiGen 2.8.0