jResponseBasicHtml

Extends \jResponse

Basic HTML response. the HTML content should be provided by a simple php file.

package

jelix

subpackage

core_response

Methods

constructor

__construct() 
inherited

check if the request is of type GET or HEAD

_checkRequestType() 
inherited

Normalize a date into GMT format

_normalizeDate(mixed $date) : string
inherited

Arguments

$date

mixed

Can be a jDateTime object, a DateTime object or a string understandable by strtotime

Response

string

a date in GMT format

add content to the body you can add additionnal content, before or after the content of body

addContent(string $content, boolean $before = false) 

Arguments

$content

string

additionnal html content

$before

boolean

true if you want to add it before the content, else false for after

add additional content into the document head

addHeadContent(string $content, boolean $toTop = false) 
final
since 1.0b1

Arguments

$content

string

$toTop

boolean

true if you want to add it at the top of the head content, else false for the bottom

add an http header to the response.

addHttpHeader(string $htype, string $hcontent, integer $overwrite = true) 
inherited

will be send during the output of the response

Arguments

$htype

string

the header type ("Content-Type", "Date-modified"...)

$hcontent

string

value of the header type

$overwrite

integer

false or 0 if the value should be set only if it doesn't still exist -1 to add the header with the existing values true or 1 to replace the existing header

Clean the differents caches headers

cleanCacheHeaders() 
inherited

delete all http headers

clearHttpHeaders() 
inherited

The method you can overload in your inherited html response overload it if you want to add processes (stylesheet, head settings, additionnal content etc.

doAfterActions() 

.) after any actions

since 1.1

return the format type name (eg the family type name)

getFormatType() : string
inherited

Response

string

the name

return the corresponding plugin

getPlugin(string $name) : \jIHTMLResponsePlugin|null
since 1.3a1

Arguments

$name

string

the name of the plugin

Response

\jIHTMLResponsePlugin|null

the plugin or null if it isn't loaded

return the response type name

getType() : string
inherited final

Response

string

the name

Use the HTPP headers Last-Modified to see if the ressource in client cache is fresh

isValidCache(mixed $dateLastModified = null,  $etag = null, boolean $cleanCacheHeader = true) : boolean
inherited

Arguments

$dateLastModified

mixed

Can be a jDateTime object, a DateTime object or a string understandable by strtotime

$etag

$cleanCacheHeader

boolean

True for clean/delete other cache headers. Default : true.

Response

boolean

True if the client ressource version is fresh, false otherwise

says if the response will be xhtml or html

isXhtml() : boolean
final

Response

boolean

true if it is xhtml

output the html content

output() : boolean
Throws
\Exception

Response

boolean

true if the generated content is ok

Send a response with a generic error message.

outputErrors() 
inherited

send http headers

sendHttpHeaders() 
inherited

set the content-type in the http headers

setContentType() 

Set an expires header to the page/ressource.

setExpires( $date,  $cleanCacheHeader = true) 
inherited
see \_normalizeDate

Arguments

$date

$cleanCacheHeader

set the http status code for the http header

setHttpStatus(string $code, string $msg) 
inherited

Arguments

$code

string

the status code (200, 404...)

$msg

string

the message following the status code ("OK", "Not Found"..)

Set a life time for the page/ressource.

setLifetime(integer $time, boolean $sharedCache = false,  $cleanCacheHeader = true) 
inherited

Arguments

$time

integer

Time during which the page will be cached. Express in seconds.

$sharedCache

boolean

True if the lifetime concern a public/shared cache. Default : false.

$cleanCacheHeader

change the type of html for the output

setXhtmlOutput(boolean $xhtml = true) 

Arguments

$xhtml

boolean

true if you want xhtml, false if you want html

Properties

ident of the response type

_type : string
inherited
var

ident of the response type

Type(s)

string

the charset of the document

_charset : string
var

Type(s)

string

the lang of the document

_lang : string
var

Type(s)

string

says if the document is in xhtml or html

_isXhtml : 

Type(s)

says if xhtml content type should be send or not.

xhtmlContentType : boolean

it true, a verification of HTTP_ACCEPT is done.

var

Type(s)

boolean

top content for head

_headTop : 

Type(s)

bottom content for head

_headBottom : 

Type(s)

_bodyTop

_bodyTop : 

Type(s)

_bodyBottom

_bodyBottom : 

Type(s)

full path of php file to output. it should content php instruction to display these variables: - $HEADTOP: content added just after the opening <head> tag - $HEADBOTTOM: content before the closing </head> tag - $BODYTOP: content just after the <body> tag, at the top of the page - $BODYBOTTOM: content just before the </body> tag, at the bottom of the page - $BASEPATH: base path of the application, for links of your style sheets etc.

htmlFile : string

.

var

Type(s)

string

list of plugins

plugins : array<mixed,\jIHTMLResponsePlugin>
var
since

Type(s)

array<mixed,\jIHTMLResponsePlugin>

list of http headers that will be send to the client

_httpHeaders : array
inherited
var

list of http headers that will be send to the client

Type(s)

array

indicates if http headers have already been sent to the client

_httpHeadersSent : boolean
inherited
var

indicates if http headers have already been sent to the client

Type(s)

boolean

the http status code to send

_httpStatusCode : string
inherited
var

the http status code to send

Type(s)

string

the http status message to send

_httpStatusMsg : string
inherited
var

the http status message to send

Type(s)

string

Should we output only the headers or the entire response

_outputOnlyHeaders : boolean
inherited
var

Should we output only the headers or the entire response

Type(s)

boolean

httpVersion

httpVersion : 
inherited

Type(s)

forcedHttpVersion

forcedHttpVersion : 
inherited

Type(s)