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

Helper for printing sitemaps. More...

Public Member Functions

 __invoke ($container=null)
 Helper entry point.
 
 render ($container=null)
 Renders helper.
 
 getDomSitemap (AbstractContainer $container=null)
 Returns a DOMDocument containing the Sitemap XML for the given container.
 
 url (AbstractPage $page)
 Returns an escaped absolute URL for the given page.
 
 setFormatOutput ($formatOutput=true)
 Sets whether XML output should be formatted.
 
 getFormatOutput ()
 Returns whether XML output should be formatted.
 
 setServerUrl ($serverUrl)
 Sets server url (scheme and host-related stuff without request URI)
 
 getServerUrl ()
 Returns server URL.
 
 setUseSitemapValidators ($useSitemapValidators)
 Sets whether sitemap should be validated using Zend*.
 
 getUseSitemapValidators ()
 Returns whether sitemap should be validated using Zend*.
 
 setUseSchemaValidation ($schemaValidation)
 Sets whether sitemap should be schema validated when generated.
 
 getUseSchemaValidation ()
 Returns true if sitemap should be schema validated when generated.
 
 setUseXmlDeclaration ($useXmlDecl)
 Sets whether the XML declaration should be used in output.
 
 getUseXmlDeclaration ()
 Returns whether the XML declaration should be used in output.
 
- Public Member Functions inherited from AbstractHelper
 __call ($method, array $arguments=[])
 Magic overload: Proxy calls to the navigation container.
 
 __toString ()
 Magic overload: Proxy to render().
 
 accept (AbstractPage $page, $recursive=true)
 Determines whether a page should be accepted when iterating.
 
 setAcl (Acl\AclInterface $acl=null)
 Sets ACL to use when iterating pages.
 
 getAcl ()
 Returns ACL or null if it isn't set using setAcl() or setDefaultAcl().
 
 hasAcl ()
 Checks if the helper has an ACL instance.
 
 setEventManager (EventManagerInterface $events)
 Set the event manager.
 
 getEventManager ()
 Get the event manager, if present.
 
 setContainer ($container=null)
 Sets navigation container the helper operates on by default.
 
 getContainer ()
 Returns the navigation container helper operates on by default.
 
 hasContainer ()
 Checks if the helper has a container.
 
 setIndent ($indent)
 Set the indentation string for using in render(), optionally a number of spaces to indent with.
 
 getIndent ()
 Returns indentation.
 
 setMaxDepth ($maxDepth=null)
 Sets the maximum depth a page can have to be included when rendering.
 
 getMaxDepth ()
 Returns maximum depth a page can have to be included when rendering.
 
 setMinDepth ($minDepth=null)
 Sets the minimum depth a page must have to be included when rendering.
 
 getMinDepth ()
 Returns minimum depth a page must have to be included when rendering.
 
 setRenderInvisible ($renderInvisible=true)
 Render invisible items?
 
 getRenderInvisible ()
 Return renderInvisible flag.
 
 setRole ($role=null)
 Sets ACL role(s) to use when iterating pages.
 
 getRole ()
 Returns ACL role to use when iterating pages, or null if it isn't set using setRole() or setDefaultRole().
 
 hasRole ()
 Checks if the helper has an ACL role.
 
 setServiceLocator (ContainerInterface $serviceLocator)
 Set the service locator.
 
 getServiceLocator ()
 Get the service locator.
 
 setUseAcl ($useAcl=true)
 Sets whether ACL should be used.
 
 getUseAcl ()
 Returns whether ACL should be used.
 
- Public Member Functions inherited from AbstractHtmlElement
 getClosingBracket ()
 Get the tag closing bracket.
 
- Public Member Functions inherited from AbstractHelper
 setView (Renderer $view)
 Set the View object.
 
 getView ()
 Get the view object.
 

Public Attributes

const SITEMAP_NS = 'http://www.sitemaps.org/schemas/sitemap/0.9'
 
const SITEMAP_XSD = 'http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd'
 

Protected Member Functions

 xmlEscape ($string)
 Escapes string for XML usage.
 
- Protected Member Functions inherited from AbstractHelper
 parseContainer (&$container=null)
 Verifies container and eventually fetches it from service locator if it is a string.
 
 isAllowed ($params)
 Determines whether a page should be allowed given certain parameters.
 
 getWhitespace ($indent)
 Retrieve whitespace representation of $indent.
 
 htmlAttribs ($attribs)
 Converts an associative array to a string of tag attributes.
 
 translate ($message, $textDomain=null)
 Translate a message (for label, title, …)
 
 normalizeId ($value)
 Normalize an ID.
 
 setDefaultListeners ()
 Attaches default ACL listeners, if ACLs are in use.
 
- Protected Member Functions inherited from AbstractHtmlElement
 isXhtml ()
 Is doctype XHTML?
 
 htmlAttribs ($attribs)
 Converts an associative array to a string of tag attributes.
 
 normalizeId ($value)
 Normalize an ID.
 

Protected Attributes

 $formatOutput = false
 
 $serverUrl
 
 $urls = []
 
 $useSitemapValidators = true
 
 $useSchemaValidation = false
 
 $useXmlDeclaration = true
 
- Protected Attributes inherited from AbstractHelper
 $events
 
 $container
 
 $minDepth
 
 $maxDepth
 
 $indent = ''
 
 $acl
 
 $renderInvisible = false
 
 $role
 
 $serviceLocator
 
 $useAcl = true
 
- Protected Attributes inherited from AbstractHtmlElement
 $closingBracket = null
 
- Protected Attributes inherited from AbstractHelper
 $view = null
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractHelper
static setDefaultAcl (Acl\AclInterface $acl=null)
 Sets default ACL to use if another ACL is not explicitly set.
 
static setDefaultRole ($role=null)
 Sets default ACL role(s) to use when iterating pages if not explicitly set later with setRole().
 
- Static Protected Attributes inherited from AbstractHelper
static $defaultAcl
 
static $defaultRole
 

Detailed Description

Helper for printing sitemaps.

http://www.sitemaps.org/protocol.php

Member Function Documentation

__invoke (   $container = null)

Helper entry point.

Parameters
string | AbstractContainer$containercontainer to operate on
Returns
Sitemap
getDomSitemap ( AbstractContainer  $container = null)

Returns a DOMDocument containing the Sitemap XML for the given container.

Parameters
AbstractContainer$container[optional] container to get breadcrumbs from, defaults to what is registered in the helper
Returns
DOMDocument DOM representation of the container
Exceptions
Exception\RuntimeExceptionif schema validation is on and the sitemap is invalid according to the sitemap schema, or if sitemap validators are used and the loc element fails validation
getFormatOutput ( )

Returns whether XML output should be formatted.

Returns
bool
getServerUrl ( )

Returns server URL.

Returns
string
getUseSchemaValidation ( )

Returns true if sitemap should be schema validated when generated.

Returns
bool
getUseSitemapValidators ( )

Returns whether sitemap should be validated using Zend*.

Returns
bool
getUseXmlDeclaration ( )

Returns whether the XML declaration should be used in output.

Returns
bool
render (   $container = null)

Renders helper.

Implements HelperInterface::render().

Parameters
AbstractContainer$container[optional] container to render. Default is to render the container registered in the helper.
Returns
string

Implements HelperInterface.

setFormatOutput (   $formatOutput = true)

Sets whether XML output should be formatted.

Parameters
bool$formatOutput
Returns
Sitemap
setServerUrl (   $serverUrl)

Sets server url (scheme and host-related stuff without request URI)

E.g. http://www.example.com

Parameters
string$serverUrl
Returns
Sitemap
Exceptions
Exception\InvalidArgumentException
setUseSchemaValidation (   $schemaValidation)

Sets whether sitemap should be schema validated when generated.

Parameters
bool$schemaValidation
Returns
Sitemap
setUseSitemapValidators (   $useSitemapValidators)

Sets whether sitemap should be validated using Zend*.

Parameters
bool$useSitemapValidators
Returns
Sitemap
setUseXmlDeclaration (   $useXmlDecl)

Sets whether the XML declaration should be used in output.

Parameters
bool$useXmlDecl
Returns
Sitemap
url ( AbstractPage  $page)

Returns an escaped absolute URL for the given page.

Parameters
AbstractPage$page
Returns
string
xmlEscape (   $string)
protected

Escapes string for XML usage.

Parameters
string$string
Returns
string

Member Data Documentation

$formatOutput = false
protected
$serverUrl
protected
$urls = []
protected
$useSchemaValidation = false
protected
$useSitemapValidators = true
protected
$useXmlDeclaration = true
protected
const SITEMAP_NS = 'http://www.sitemaps.org/schemas/sitemap/0.9'
const SITEMAP_XSD = 'http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd'