Zend\View\Helper\Navigation\Links
Helper for printing <link> elements
Synopsis
class Links
extends AbstractHelper
{
- // constants
- const RENDER_ALTERNATE = 0x0001;
- const RENDER_STYLESHEET = 0x0002;
- const RENDER_START = 0x0004;
- const RENDER_NEXT = 0x0008;
- const RENDER_PREV = 0x0010;
- const RENDER_CONTENTS = 0x0020;
- const RENDER_INDEX = 0x0040;
- const RENDER_GLOSSARY = 0x0080;
- const RENDER_COPYRIGHT = 0x0100;
- const RENDER_CHAPTER = 0x0200;
- const RENDER_SECTION = 0x0400;
- const RENDER_SUBSECTION = 0x0800;
- const RENDER_APPENDIX = 0x1000;
- const RENDER_HELP = 0x2000;
- const RENDER_BOOKMARK = 0x4000;
- const RENDER_CUSTOM = 0x8000;
- const RENDER_ALL = 0xffff;
- // Inherited constants from AbstractHtmlElement
- const EOL = ;
- // members
- protected array $RELATIONS;
- protected int $renderFlag;
- protected AbstractContainer $root;
- // Inherited members from AbstractHelper
- protected EventManagerInterface $events;
- protected ServiceLocatorInterface $serviceLocator;
- protected AbstractContainer $container;
- protected int $minDepth;
- protected int $maxDepth;
- protected string $indent;
- protected AclInterface $acl;
- protected bool $renderInvisible;
- protected RoleInterface $role;
- protected bool $useAcl;
- protected TranslatorInterface $translator;
- protected string $translatorTextDomain;
- protected bool $translatorEnabled;
- protected AclInterface $defaultAcl;
- protected RoleInterface $defaultRole;
- // Inherited members from AbstractHtmlElement
- protected string $closingBracket;
- // Inherited members from AbstractHelper
- protected RendererInterface $view;
- // methods
- public Links __invoke()
- public mixed __call()
- public string render()
- public string renderLink()
- public array findAllRelations()
- public AbstractPage|array|null findRelation()
- protected AbstractPage|array|null findFromProperty()
- protected array|null findFromSearch()
- public AbstractPage|null searchRelStart()
- public AbstractPage|null searchRelNext()
- public AbstractPage|null searchRelPrev()
- public AbstractPage|array|null searchRelChapter()
- public AbstractPage|array|null searchRelSection()
- public AbstractPage|array|null searchRelSubsection()
- public AbstractPage|null searchRevSection()
- public AbstractPage|null searchRevSubsection()
- protected AbstractContainer findRoot()
- protected AbstractPage|array|null convertToPages()
- public Links setRenderFlag()
- public int getRenderFlag()
- // Inherited methods from AbstractHelper
- public mixed __call()
- public string __toString()
- public array findActive()
- protected void parseContainer()
- public bool accept()
- protected bool isAllowed()
- protected string getWhitespace()
- protected string htmlAttribs()
- public string htmlify()
- protected string translate()
- protected string normalizeId()
- public AbstractHelper setAcl()
- public AclInterface|null getAcl()
- public bool hasAcl()
- public AbstractHelper setEventManager()
- public EventManagerInterface getEventManager()
- public AbstractHelper setContainer()
- public AbstractContainer getContainer()
- public bool hasContainer()
- public AbstractHelper setIndent()
- public string getIndent()
- public AbstractHelper setMaxDepth()
- public int|null getMaxDepth()
- public AbstractHelper setMinDepth()
- public int|null getMinDepth()
- public AbstractHelper setRenderInvisible()
- public bool getRenderInvisible()
- public AbstractHelper setRole()
- public RoleInterface|null getRole()
- public bool hasRole()
- public AbstractHelper setServiceLocator()
- public ServiceLocatorInterface getServiceLocator()
- public AbstractHelper setTranslator()
- public Translator|null getTranslator()
- public bool hasTranslator()
- public AbstractHelper setTranslatorEnabled()
- public bool isTranslatorEnabled()
- public AbstractHelper setTranslatorTextDomain()
- public string getTranslatorTextDomain()
- public AbstractHelper setUseAcl()
- public bool getUseAcl()
- public static void setDefaultAcl()
- public static void setDefaultRole()
- protected void setDefaultListeners()
- // Inherited methods from AbstractHtmlElement
- public string getClosingBracket()
- protected bool isXhtml()
- protected string htmlAttribs()
- protected string normalizeId()
- // Inherited methods from AbstractHelper
- public AbstractHelper setView()
- public null|Renderer getView()
Hierarchy
Tasks
Line | Task |
---|---|
213 | add more attribs |
Constants
Name | Value |
---|---|
RENDER_ALTERNATE | 0x0001 |
RENDER_STYLESHEET | 0x0002 |
RENDER_START | 0x0004 |
RENDER_NEXT | 0x0008 |
RENDER_PREV | 0x0010 |
RENDER_CONTENTS | 0x0020 |
RENDER_INDEX | 0x0040 |
RENDER_GLOSSARY | 0x0080 |
RENDER_COPYRIGHT | 0x0100 |
RENDER_CHAPTER | 0x0200 |
RENDER_SECTION | 0x0400 |
RENDER_SUBSECTION | 0x0800 |
RENDER_APPENDIX | 0x1000 |
RENDER_HELP | 0x2000 |
RENDER_BOOKMARK | 0x4000 |
RENDER_CUSTOM | 0x8000 |
RENDER_ALL | 0xffff |
EOL |
Members
protected
- $RELATIONS
—
array
Maps render constants to W3C link types - $acl
—
Zend\View\Helper\Navigation\Acl\AclInterface
ACL to use when iterating pages - $closingBracket
—
string
The tag closing bracket - $container
—
Zend\View\Helper\Navigation\Navigation\AbstractContainer
AbstractContainer to operate on by default - $defaultAcl
—
Zend\View\Helper\Navigation\Acl\AclInterface
Default ACL to use when iterating pages if not explicitly set in the instance by calling {@link setAcl()} - $defaultRole
—
Zend\View\Helper\Navigation\string|Acl\Role\RoleInterface
Default ACL role to use when iterating pages if not explicitly set in the instance by calling {@link setRole()} - $events — Zend\EventManager\EventManagerInterface
- $indent
—
string
Indentation string - $maxDepth
—
int
The maximum depth a page can have to be included when rendering - $minDepth
—
int
The minimum depth a page must have to be included when rendering - $renderFlag
—
int
The helper's render flag - $renderInvisible
—
Zend\View\Helper\Navigation\bool
Whether invisible items should be rendered by this helper - $role
—
Zend\View\Helper\Navigation\string|Acl\Role\RoleInterface
ACL role to use when iterating pages - $root
—
Zend\Navigation\AbstractContainer
Root container - $serviceLocator — Zend\ServiceManager\ServiceLocatorInterface
- $translator
—
Zend\I18n\Translator\TranslatorInterface
Translator (optional) - $translatorEnabled
—
Zend\View\Helper\Navigation\bool
Whether translator should be used - $translatorTextDomain
—
string
Translator text domain (optional) - $useAcl
—
Zend\View\Helper\Navigation\bool
Whether ACL should be used for filtering out pages - $view
—
Zend\View\Renderer\RendererInterface
View object instance
Methods
protected
- convertToPages() — Converts a $mixed value to an array of pages
- findFromProperty() — Finds relations of given $type for $page by checking if the relation is specified as a property of $page
- findFromSearch() — Finds relations of given $rel=$type for $page by using the helper to search for the relation in the root container
- findRoot() — Returns the root container of the given page
public
- __call() — Magic overload: Proxy calls to {@link findRelation()} or container
- __invoke() — Helper entry point
- findAllRelations() — Finds all relations (forward and reverse) for the given $page
- findRelation() — Finds relations of the given $rel=$type from $page
- getRenderFlag() — Returns the helper's render flag
- render() — Renders helper
- renderLink() — Renders the given $page as a link element, with $attrib = $relation
- searchRelChapter() — Searches the root container for forward 'chapter' relations of the given $page
- searchRelNext() — Searches the root container for the forward 'next' relation of the given $page
- searchRelPrev() — Searches the root container for the forward 'prev' relation of the given $page
- searchRelSection() — Searches the root container for forward 'section' relations of the given $page
- searchRelStart() — Searches the root container for the forward 'start' relation of the given $page
- searchRelSubsection() — Searches the root container for forward 'subsection' relations of the given $page
- searchRevSection() — Searches the root container for the reverse 'section' relation of the given $page
- searchRevSubsection() — Searches the root container for the reverse 'section' relation of the given $page
- setRenderFlag() — Sets the helper's render flag
Inherited from Zend\View\Helper\Navigation\AbstractHelper
protected
- getWhitespace() — Retrieve whitespace representation of $indent
- htmlAttribs() — Converts an associative array to a string of tag attributes.
- isAllowed() — Determines whether a page should be allowed given certain parameters
- normalizeId() — Normalize an ID
- parseContainer() — Verifies container and eventually fetches it from service locator if it is a string
- setDefaultListeners() — Attaches default ACL listeners, if ACLs are in use
- translate() — Translate a message (for label, title, …)
public
- __call() — Magic overload: Proxy calls to the navigation container
- __toString() — Magic overload: Proxy to {@link render()}.
- accept() — Determines whether a page should be accepted when iterating
- findActive() — Finds the deepest active page in the given container
- getAcl() — Returns ACL or null if it isn't set using {@link setAcl()} or {@link setDefaultAcl()}
- getContainer() — Returns the navigation container helper operates on by default
- getEventManager() — Get the event manager.
- getIndent() — Returns indentation
- getMaxDepth() — Returns maximum depth a page can have to be included when rendering
- getMinDepth() — Returns minimum depth a page must have to be included when rendering
- getRenderInvisible() — Return renderInvisible flag
- getRole() — Returns ACL role to use when iterating pages, or null if it isn't set using {@link setRole()} or {@link setDefaultRole()}
- getServiceLocator() — Get the service locator.
- getTranslator() — Returns translator used in helper
- getTranslatorTextDomain() — Return the translation text domain
- getUseAcl() — Returns whether ACL should be used
- hasAcl() — Checks if the helper has an ACL instance
- hasContainer() — Checks if the helper has a container
- hasRole() — Checks if the helper has an ACL role
- hasTranslator() — Checks if the helper has a translator
- htmlify() — Returns an HTML string containing an 'a' element for the given page
- isTranslatorEnabled() — Returns whether translator is enabled and should be used
- setAcl() — Sets ACL to use when iterating pages
- setContainer() — Sets navigation container the helper operates on by default
- setDefaultAcl() — Sets default ACL to use if another ACL is not explicitly set
- setDefaultRole() — Sets default ACL role(s) to use when iterating pages if not explicitly set later with {@link setRole()}
- setEventManager() — Set the event manager.
- setIndent() — Set the indentation string for using in {@link render()}, optionally a number of spaces to indent with
- setMaxDepth() — Sets the maximum depth a page can have to be included when rendering
- setMinDepth() — Sets the minimum depth a page must have to be included when rendering
- setRenderInvisible() — Render invisible items?
- setRole() — Sets ACL role(s) to use when iterating pages
- setServiceLocator() — Set the service locator.
- setTranslator() — Sets translator to use in helper
- setTranslatorEnabled() — Sets whether translator is enabled and should be used
- setTranslatorTextDomain() — Set translation text domain
- setUseAcl() — Sets whether ACL should be used
Inherited from Zend\View\Helper\AbstractHtmlElement
protected
- htmlAttribs() — Converts an associative array to a string of tag attributes.
- isXhtml() — Is doctype XHTML?
- normalizeId() — Normalize an ID
public
- getClosingBracket() — Get the tag closing bracket