Zend Framework  3.0
Public Member Functions | Static Public Member Functions | Public Attributes | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Doctype Class Reference

Helper for setting and retrieving the doctype. More...

Public Member Functions

 __construct ()
 Constructor.
 
 __invoke ($doctype=null)
 Set or retrieve doctype.
 
 __toString ()
 String representation of doctype.
 
 setDoctype ($doctype)
 Set doctype.
 
 getDoctype ()
 Retrieve doctype.
 
 getDoctypes ()
 Get doctype => string mappings.
 
 isXhtml ()
 Is doctype XHTML?
 
 isHtml5 ()
 Is doctype HTML5? (HeadMeta uses this for validation)
 
 isRdfa ()
 Is doctype RDFa?
 
- Public Member Functions inherited from AbstractHelper
 setView (Renderer $view)
 Set the View object.
 
 getView ()
 Get the view object.
 

Static Public Member Functions

static unsetDoctypeRegistry ()
 Unset the static doctype registry.
 

Public Attributes

const XHTML11 = 'XHTML11'
 #@+ DocType constants
 
const XHTML1_STRICT = 'XHTML1_STRICT'
 
const XHTML1_TRANSITIONAL = 'XHTML1_TRANSITIONAL'
 
const XHTML1_FRAMESET = 'XHTML1_FRAMESET'
 
const XHTML1_RDFA = 'XHTML1_RDFA'
 
const XHTML1_RDFA11 = 'XHTML1_RDFA11'
 
const XHTML_BASIC1 = 'XHTML_BASIC1'
 
const XHTML5 = 'XHTML5'
 
const HTML4_STRICT = 'HTML4_STRICT'
 
const HTML4_LOOSE = 'HTML4_LOOSE'
 
const HTML4_FRAMESET = 'HTML4_FRAMESET'
 
const HTML5 = 'HTML5'
 
const CUSTOM_XHTML = 'CUSTOM_XHTML'
 
const CUSTOM = 'CUSTOM'
 

Static Protected Member Functions

static registerDefaultDoctypes ()
 Register the default doctypes we understand.
 

Protected Attributes

 $defaultDoctype = self::HTML4_LOOSE
 
 $registry
 
- Protected Attributes inherited from AbstractHelper
 $view = null
 

Static Protected Attributes

static $registeredDoctypes
 

Detailed Description

Helper for setting and retrieving the doctype.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Map constants to doctype strings, and set default doctype

Member Function Documentation

__invoke (   $doctype = null)

Set or retrieve doctype.

Parameters
string$doctype
Exceptions
Exception\DomainException
Returns
Doctype
__toString ( )

String representation of doctype.

Returns
string
getDoctype ( )

Retrieve doctype.

Returns
string
getDoctypes ( )

Get doctype => string mappings.

Returns
array
isHtml5 ( )

Is doctype HTML5? (HeadMeta uses this for validation)

Returns
bool
isRdfa ( )

Is doctype RDFa?

Returns
bool
isXhtml ( )

Is doctype XHTML?

Returns
bool
static registerDefaultDoctypes ( )
staticprotected

Register the default doctypes we understand.

Returns
void
setDoctype (   $doctype)

Set doctype.

Parameters
string$doctype
Returns
Doctype
static unsetDoctypeRegistry ( )
static

Unset the static doctype registry.

Mainly useful for testing purposes. Sets $registeredDoctypes to a null value.

Returns
void

Member Data Documentation

$defaultDoctype = self::HTML4_LOOSE
protected
$registeredDoctypes
staticprotected
$registry
protected
const CUSTOM = 'CUSTOM'
const CUSTOM_XHTML = 'CUSTOM_XHTML'
const HTML4_FRAMESET = 'HTML4_FRAMESET'
const HTML4_LOOSE = 'HTML4_LOOSE'
const HTML4_STRICT = 'HTML4_STRICT'
const HTML5 = 'HTML5'
const XHTML11 = 'XHTML11'

#@+ DocType constants

const XHTML1_FRAMESET = 'XHTML1_FRAMESET'
const XHTML1_RDFA = 'XHTML1_RDFA'
const XHTML1_RDFA11 = 'XHTML1_RDFA11'
const XHTML1_STRICT = 'XHTML1_STRICT'
const XHTML1_TRANSITIONAL = 'XHTML1_TRANSITIONAL'
const XHTML5 = 'XHTML5'
const XHTML_BASIC1 = 'XHTML_BASIC1'