Hawk - PHP documentation
  • Namespace
  • Class
  • Tree

Namespaces

  • Hawk
    • View
      • Plugins

Classes

  • App
  • ButtonInput
  • Cache
  • CheckboxInput
  • ColorInput
  • Conf
  • Controller
  • Crypto
  • DatabaseSessionHandler
  • DatetimeInput
  • DB
  • DBExample
  • DeleteInput
  • Dialogbox
  • EmailInput
  • ErrorHandler
  • Event
  • FileInput
  • FileSystem
  • FloatInput
  • Form
  • FormFieldset
  • FormInput
  • GenericModel
  • GifImage
  • HawkApi
  • HawkUpdater
  • HiddenInput
  • HtmlInput
  • HTTPRequest
  • Icon
  • Image
  • IntegerInput
  • ItemList
  • ItemListField
  • JpegImage
  • Lang
  • Language
  • LeftSidebarTab
  • Less
  • Logger
  • Mail
  • MenuItem
  • Model
  • NoSidebarTab
  • NumberInput
  • ObjectInput
  • Option
  • Panel
  • PasswordInput
  • Permission
  • Plugin
  • PluginInstaller
  • PngImage
  • ProfileQuestion
  • ProfileQuestionValue
  • RadioInput
  • Request
  • Response
  • RightSidebarTab
  • Role
  • RolePermission
  • Route
  • Router
  • SelectInput
  • Session
  • Singleton
  • SubmitInput
  • Tabs
  • TextareaInput
  • TextInput
  • Theme
  • TimeInput
  • Upload
  • User
  • View
  • ViewPlugin
  • Widget
  • WysiwygInput

Traits

  • Utils

Exceptions

  • AppStopException
  • DBExampleException
  • DBException
  • FileSystemException
  • HawkApiException
  • ImageException
  • MailException
  • UploadException
  • ViewException

Class Response

This class defines static methods to prepare and send the HTTP response to the client

Hawk\Singleton
Extended by Hawk\Response
Final
Namespace: Hawk
Package: Core
Located at Response.php

Methods summary

protected
# __construct( )

Constructor

Constructor

Overrides

Hawk\Singleton::__construct
public string
# getBody( )

Get the content to return

Get the content to return

Returns

string
public
# setBody( mixed $body )

Set the content to return to the client

Set the content to return to the client

Parameters

$body
The content to set
public
# header( string $name, string $value )

Set response headers

Set response headers

Parameters

$name
The header name
$value
The header value
public
# setCookie( string $name, mixed $data )

Set response cookie

Set response cookie

Parameters

$name
The cookie name
$data

The cookie $data. Can be a string value, or an array containing the properties 'value', 'expires', 'path', 'domain', 'secure' or 'httponly'

public
# setContentType( string $type )

Set the content type of the HTTP response

Set the content type of the HTTP response

Parameters

$type
The type to set
public
# setHtml( )

Set the response as HTML

Set the response as HTML

public
# setJson( )

Set the response as JSON

Set the response as JSON

public
# setScript( )

Set the response as JavaScript

Set the response as JavaScript

public
# getContentType( )

Get the response type

Get the response type

public
# setStatus( integer $code )

Set the response HTTP code

Set the response HTTP code

Parameters

$code
The HTTP code to set
public integer
# getStatus( )

Get the response HTTP status

Get the response HTTP status

Returns

integer
public
# end( string $content = null )

Return the HTTP response to the client, add exit the script

Return the HTTP response to the client, add exit the script

Parameters

$content
The content to set in the response body before returning it to the client
public
# redirect( string $url )

Redirect to another URL

Redirect to another URL

Parameters

$url
The URL to redirect to
public
# redirectToAction( string $route, array $vars = array() )

Redirect to a route

Redirect to a route

Parameters

$route
The route name to redirect to
$vars
The route parameters value to set

Methods inherited from Hawk\Singleton

getInstance()

Properties summary

protected static Hawk\Response $instance

The response instance

The response instance

#
Hawk - PHP documentation API documentation generated by ApiGen