Class Sitemap

Summary

Fully Qualified Name: Zend\View\Helper\Navigation\Sitemap
Extends: AbstractHelper

Description

Helper for printing sitemaps

Methods

Name Description Defined By
__call() Magic overload: Proxy calls to the navigation container AbstractHelper
__invoke() Helper entry point Sitemap
__toString() Magic overload: Proxy to {@link render()}. AbstractHelper
accept() Determines whether a page should be accepted when iterating AbstractHelper
findActive() Finds the deepest active page in the given container AbstractHelper
getAcl() Returns ACL or null if it isn't set using {@link setAcl()} or {@link setDefaultAcl()} AbstractHelper
getContainer() Returns the navigation container helper operates on by default AbstractHelper
getDomSitemap() Returns a DOMDocument containing the Sitemap XML for the given container Sitemap
getEventManager() Get the event manager, if present. AbstractHelper
getFormatOutput() Returns whether XML output should be formatted Sitemap
getIndent() Returns indentation AbstractHelper
getMaxDepth() Returns maximum depth a page can have to be included when rendering AbstractHelper
getMinDepth() Returns minimum depth a page must have to be included when rendering AbstractHelper
getRenderInvisible() Return renderInvisible flag AbstractHelper
getRole() Returns ACL role to use when iterating pages, or null if it isn't set using {@link setRole()} or {@link setDefaultRole()} AbstractHelper
getServerUrl() Returns server URL Sitemap
getServiceLocator() Get the service locator. AbstractHelper
getUseAcl() Returns whether ACL should be used AbstractHelper
getUseSchemaValidation() Returns true if sitemap should be schema validated when generated Sitemap
getUseSitemapValidators() Returns whether sitemap should be validated using Zend\Validate\Sitemap_* Sitemap
getUseXmlDeclaration() Returns whether the XML declaration should be used in output Sitemap
hasAcl() Checks if the helper has an ACL instance AbstractHelper
hasContainer() Checks if the helper has a container AbstractHelper
hasRole() Checks if the helper has an ACL role AbstractHelper
htmlify() Returns an HTML string containing an 'a' element for the given page AbstractHelper
render() Renders helper Sitemap
setAcl() Sets ACL to use when iterating pages AbstractHelper
setContainer() Sets navigation container the helper operates on by default AbstractHelper
setDefaultAcl() Sets default ACL to use if another ACL is not explicitly set AbstractHelper
setDefaultRole() Sets default ACL role(s) to use when iterating pages if not explicitly set later with {@link setRole()} AbstractHelper
setEventManager() Set the event manager. AbstractHelper
setFormatOutput() Sets whether XML output should be formatted Sitemap
setIndent() Set the indentation string for using in {@link render()}, optionally a number of spaces to indent with AbstractHelper
setMaxDepth() Sets the maximum depth a page can have to be included when rendering AbstractHelper
setMinDepth() Sets the minimum depth a page must have to be included when rendering AbstractHelper
setRenderInvisible() Render invisible items? AbstractHelper
setRole() Sets ACL role(s) to use when iterating pages AbstractHelper
setServerUrl() Sets server url (scheme and host-related stuff without request URI) Sitemap
setServiceLocator() Set the service locator. AbstractHelper
setUseAcl() Sets whether ACL should be used AbstractHelper
setUseSchemaValidation() Sets whether sitemap should be schema validated when generated Sitemap
setUseSitemapValidators() Sets whether sitemap should be validated using Zend\Validate\Sitemap_* Sitemap
setUseXmlDeclaration() Sets whether the XML declaration should be used in output Sitemap
url() Returns an escaped absolute URL for the given page Sitemap

Method Details

__call()

Magic overload: Proxy calls to the navigation container

Parameter Name Type Description
$method string method
$arguments array rguments

Returns: mixed

__invoke()

Helper entry point

Parameter Name Type Description
$container string|\AbstractContainer container

Returns: \Sitemap

__toString()

Magic overload: Proxy to {@link render()}.

This method will trigger an E_USER_ERROR if rendering the helper causes an exception to be thrown.

Implements {@link HelperInterface::__toString()}.

Returns: string

accept()

Determines whether a page should be accepted when iterating

Default listener may be 'overridden' by attaching listener to 'isAllowed' method. Listener must be 'short circuited' if overriding default ACL listener.

Rules:

Parameter Name Type Description
$page \AbstractPage page
$recursive bool [optional]

Returns: bool Whether page should be accepted

findActive()

Finds the deepest active page in the given container

Parameter Name Type Description
$container \Navigation\AbstractContainer container
$minDepth int|null [optional]
$maxDepth int|null [optional]

Returns: array an associative array with the values 'depth' and 'page', or an empty array if not found

getAcl()

Returns ACL or null if it isn't set using {@link setAcl()} or {@link setDefaultAcl()}

Implements {@link HelperInterface::getAcl()}.

Returns: \Acl\AclInterface|null ACL object or null

getContainer()

Returns the navigation container helper operates on by default

Implements {@link HelperInterface::getContainer()}.

If no container is set, a new container will be instantiated and stored in the helper.

Returns: \Navigation\AbstractContainer navigation container

getDomSitemap()

Returns a DOMDocument containing the Sitemap XML for the given container

Parameter Name Type Description
$container \AbstractContainer [optional]

Returns: \DOMDocument DOM representation of the container

getEventManager()

Get the event manager, if present.

Internally, the helper will lazy-load an EM instance the first time it requires one, but ideally it should be injected during instantiation.

Returns: null|\EventManagerInterface

getFormatOutput()

Returns whether XML output should be formatted

Returns: bool

getIndent()

Returns indentation

Returns: string

getMaxDepth()

Returns maximum depth a page can have to be included when rendering

Returns: int|null

getMinDepth()

Returns minimum depth a page must have to be included when rendering

Returns: int|null

getRenderInvisible()

Return renderInvisible flag

Returns: bool

getRole()

Returns ACL role to use when iterating pages, or null if it isn't set using {@link setRole()} or {@link setDefaultRole()}

Implements {@link HelperInterface::getRole()}.

Returns: string|\Acl\Role\RoleInterface|null

getServerUrl()

Returns server URL

Returns: string

getServiceLocator()

Get the service locator.

Used internally to pull named navigation containers to render.

Returns: \ContainerInterface

getUseAcl()

Returns whether ACL should be used

Implements {@link HelperInterface::getUseAcl()}.

Returns: bool

getUseSchemaValidation()

Returns true if sitemap should be schema validated when generated

Returns: bool

getUseSitemapValidators()

Returns whether sitemap should be validated using Zend\Validate\Sitemap_*

Returns: bool

getUseXmlDeclaration()

Returns whether the XML declaration should be used in output

Returns: bool

hasAcl()

Checks if the helper has an ACL instance

Implements {@link HelperInterface::hasAcl()}.

Returns: bool

hasContainer()

Checks if the helper has a container

Implements {@link HelperInterface::hasContainer()}.

Returns: bool

hasRole()

Checks if the helper has an ACL role

Implements {@link HelperInterface::hasRole()}.

Returns: bool

htmlify()

Returns an HTML string containing an 'a' element for the given page

Parameter Name Type Description
$page \AbstractPage page

Returns: string HTML string (<a href="…">Label</a>)

render()

Renders helper

Implements {@link HelperInterface::render()}.

Parameter Name Type Description
$container \AbstractContainer [optional]

Returns: string

setAcl()

Sets ACL to use when iterating pages

Implements {@link HelperInterface::setAcl()}.

Parameter Name Type Description
$acl \Acl\AclInterface ACL

Returns: \AbstractHelper

setContainer()

Sets navigation container the helper operates on by default

Implements {@link HelperInterface::setContainer()}.

Parameter Name Type Description
$container string|\Navigation\AbstractContainer Default

Returns: \AbstractHelper

setDefaultAcl()

Sets default ACL to use if another ACL is not explicitly set

Parameter Name Type Description
$acl \Acl\AclInterface [optional]

Returns: void

setDefaultRole()

Sets default ACL role(s) to use when iterating pages if not explicitly set later with {@link setRole()}

Parameter Name Type Description
$role mixed [optional]

Returns: void

setEventManager()

Set the event manager.

Parameter Name Type Description
$events \EventManagerInterface

Returns: \AbstractHelper

setFormatOutput()

Sets whether XML output should be formatted

Parameter Name Type Description
$formatOutput bool

Returns: \Sitemap

setIndent()

Set the indentation string for using in {@link render()}, optionally a number of spaces to indent with

Parameter Name Type Description
$indent string|int

Returns: \AbstractHelper

setMaxDepth()

Sets the maximum depth a page can have to be included when rendering

Parameter Name Type Description
$maxDepth int Default

Returns: \AbstractHelper

setMinDepth()

Sets the minimum depth a page must have to be included when rendering

Parameter Name Type Description
$minDepth int Default

Returns: \AbstractHelper

setRenderInvisible()

Render invisible items?

Parameter Name Type Description
$renderInvisible bool

Returns: \AbstractHelper

setRole()

Sets ACL role(s) to use when iterating pages

Implements {@link HelperInterface::setRole()}.

Parameter Name Type Description
$role mixed [optional]

Returns: \AbstractHelper

setServerUrl()

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

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

Parameter Name Type Description
$serverUrl string

Returns: \Sitemap

setServiceLocator()

Set the service locator.

Used internally to pull named navigation containers to render.

Parameter Name Type Description
$serviceLocator \ContainerInterface

Returns: \AbstractHelper

setUseAcl()

Sets whether ACL should be used

Implements {@link HelperInterface::setUseAcl()}.

Parameter Name Type Description
$useAcl bool

Returns: \AbstractHelper

setUseSchemaValidation()

Sets whether sitemap should be schema validated when generated

Parameter Name Type Description
$schemaValidation bool

Returns: \Sitemap

setUseSitemapValidators()

Sets whether sitemap should be validated using Zend\Validate\Sitemap_*

Parameter Name Type Description
$useSitemapValidators bool

Returns: \Sitemap

setUseXmlDeclaration()

Sets whether the XML declaration should be used in output

Parameter Name Type Description
$useXmlDecl bool

Returns: \Sitemap

url()

Returns an escaped absolute URL for the given page

Parameter Name Type Description
$page \AbstractPage

Returns: string

Top