Helper for printing elements
category | Zend |
---|---|
package | Zend_View |
subpackage | Helper |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_View_Helper_Navigation_HelperAbstract |
__call(string $method, array $arguments = array()
)
Examples of finder calls:
// METHOD // SAME AS
$h->findRelNext($page); // $h->findRelation($page, 'rel', 'next')
$h->findRevSection($page); // $h->findRelation($page, 'rev', 'section');
$h->findRelFoo($page); // $h->findRelation($page, 'rel', 'foo');
inherited_from | \Zend_View_Helper_Navigation_HelperAbstract::__call() |
---|
string
method name
array
method arguments
\Zend_Navigation_Exception |
if method does not exist in container |
---|
__call(string $method, array $arguments = array()
) : mixed
string
method name in container
array
[optional] arguments to pass
\Zend_Navigation_Exception |
if method does not exist in container |
---|
mixed
returns what the container returns__toString() : string
This method will trigger an E_USER_ERROR if rendering the helper causes an exception to be thrown.
Implements Zend_View_Helper_Navigation_Helper::__toString().
inherited_from | \Zend_View_Helper_Navigation_Helper::__toString() |
---|
string
accept(\Zend_Navigation_Page $page, boolean $recursive = true
) : boolean
Rules:
\Zend_Navigation_Page
page to check
boolean
[optional] if true, page will not be accepted if it is the descendant of a page that is not accepted. Default is true.
boolean
whether page should be accepteddirect() : void
inherited_from | \Zend_View_Helper_Interface::direct() |
---|
findActive(\Zend_Navigation_Container $container, integer|null $minDepth= null
, $maxDepth= -1
) : array
\Zend_Navigation_Container
container to search
integer
null
integer
null
[optional] minimum depth required for page to be valid. Default is to use {@link getMinDepth()}. A null value means no minimum depth required.
array
an associative array with
the values 'depth' and
'page', or an empty array
if not foundfindAllRelations(\Zend_Navigation_Page $page, $flag = null
) : array
The form of the returned array:
// $page denotes an instance of Zend_Navigation_Page
$returned = array(
'rel' => array(
'alternate' => array($page, $page, $page),
'start' => array($page),
'next' => array($page),
'prev' => array($page),
'canonical' => array($page)
),
'rev' => array(
'section' => array($page)
)
);
\Zend_Navigation_Page
page to find links for
array
related pagesfindRelation(\Zend_Navigation_Page $page, string $rel, string $type) : \Zend_Navigaiton_Page | array | null
This method will first look for relations in the page instance, then by searching the root container if nothing was found in the page.
\Zend_Navigation_Page
page to find relations for
string
relation, "rel" or "rev"
string
link type, e.g. 'start', 'next'
\Zend_View_Exception |
if $rel is not "rel" or "rev" |
---|
\Zend_Navigaiton_Page
array
null
page(s), or null if not foundgetAcl() : \Zend_Acl | null
Implements Zend_View_Helper_Navigation_Helper::getAcl().
inherited_from | \Zend_View_Helper_Navigation_Helper::getAcl() |
---|
\Zend_Acl
null
ACL object or nullgetClosingBracket() : string
string
getContainer() : \Zend_Navigation_Container
Implements \Zend_View_Helper_Navigation_Interface::getContainer().
If a helper is not explicitly set in this helper instance by calling \setContainer() or by passing it through the helper entry point, this method will look in Zend_Registry for a container by using the key 'Zend_Navigation'.
If no container is set, and nothing is found in Zend_Registry, a new container will be instantiated and stored in the helper.
inherited_from | \Zend_View_Helper_Navigation_Helper::getContainer() |
---|
\Zend_Navigation_Container
navigation containergetEOL() : string
getFormatOutput() : boolean
boolean
whether HTML/XML output should be formattedgetIndent() : string
string
indentation string or an empty stringgetMaxDepth() : integer | null
integer
null
maximum depth or nullgetMinDepth() : integer | null
integer
null
minimum depth or nullgetPrefixForId() : string
string
Prefix forgetRenderFlag() : integer
integer
render flaggetRenderInvisible() : boolean
inherited_from | \Zend_View_Helper_Navigation_Helper::getRenderInvisible() |
---|
boolean
getRole() : string | \Zend_Acl_Role_Interface | null
Implements Zend_View_Helper_Navigation_Helper::getRole().
inherited_from | \Zend_View_Helper_Navigation_Helper::getRole() |
---|
string
\Zend_Acl_Role_Interface
null
role or nullgetTranslator() : \Zend_Translate_Adapter | null
inherited_from | \Zend_View_Helper_Navigation_Helper::getTranslator() |
---|
\Zend_Translate_Adapter
null
translator or nullgetUseAcl() : boolean
Implements Zend_View_Helper_Navigation_Helper::getUseAcl().
inherited_from | \Zend_View_Helper_Navigation_Helper::getUseAcl() |
---|
boolean
whether ACL should be usedgetUseTranslator() : boolean
inherited_from | \Zend_View_Helper_Navigation_Helper::getUseTranslator() |
---|
boolean
whether translator should be usedhasAcl() : boolean
Implements Zend_View_Helper_Navigation_Helper::hasAcl().
inherited_from | \Zend_View_Helper_Navigation_Helper::hasAcl() |
---|
boolean
whether the helper has a an ACL instance or nothasContainer() : boolean
inherited_from | \Zend_View_Helper_Navigation_Helper::hasContainer() |
---|
boolean
whether the helper has a container or nothasRole() : boolean
Implements Zend_View_Helper_Navigation_Helper::hasRole().
inherited_from | \Zend_View_Helper_Navigation_Helper::hasRole() |
---|
boolean
whether the helper has a an ACL role or nothasTranslator() : boolean
inherited_from | \Zend_View_Helper_Navigation_Helper::hasTranslator() |
---|
boolean
whether the helper has a translator or nothtmlify(\Zend_Navigation_Page $page) : string
\Zend_Navigation_Page
page to generate HTML for
string
HTML string for the given pagelinks(\Zend_Navigation_Container $container = null
) : \Zend_View_Helper_Navigation_Links
\Zend_Navigation_Container
[optional] container to operate on
\Zend_View_Helper_Navigation_Links
fluent interface, returns
selfrender(\Zend_Navigation_Container $container = null
) : string
Implements Zend_View_Helper_Navigation_Helper::render().
\Zend_Navigation_Container
[optional] container to render. Default is to render the container registered in the helper.
string
helper outputrenderLink(\Zend_Navigation_Page $page, string $attrib, string $relation) : string
\Zend_Navigation_Page
the page to render the link for
string
the attribute to use for $type, either 'rel' or 'rev'
string
relation type, muse be one of; alternate, appendix, bookmark, chapter, contents, copyright, glossary, help, home, index, next, prev, section, start, stylesheet, subsection
\Zend_View_Exception |
if $attrib is invalid |
---|
string
rendered link elementsearchRelChapter(\Zend_Navigation_Page $page) : \Zend_Navigation_Page | array | null
From http://www.w3.org/TR/html4/types.html#type-links: Refers to a document serving as a chapter in a collection of documents.
\Zend_Navigation_Page
page to find relation for
\Zend_Navigation_Page
array
null
page(s) or nullsearchRelNext(\Zend_Navigation_Page $page) : \Zend_Navigation_Page | null
From http://www.w3.org/TR/html4/types.html#type-links: Refers to the next document in a linear sequence of documents. User agents may choose to preload the "next" document, to reduce the perceived load time.
\Zend_Navigation_Page
page to find relation for
\Zend_Navigation_Page
null
page(s) or nullsearchRelPrev(\Zend_Navigation_Page $page) : \Zend_Navigation_Page | null
From http://www.w3.org/TR/html4/types.html#type-links: Refers to the previous document in an ordered series of documents. Some user agents also support the synonym "Previous".
\Zend_Navigation_Page
page to find relation for
\Zend_Navigation_Page
null
page or nullsearchRelSection(\Zend_Navigation_Page $page) : \Zend_Navigation_Page | array | null
From http://www.w3.org/TR/html4/types.html#type-links: Refers to a document serving as a section in a collection of documents.
\Zend_Navigation_Page
page to find relation for
\Zend_Navigation_Page
array
null
page(s) or nullsearchRelStart(\Zend_Navigation_Page $page) : \Zend_Navigation_Page | null
From http://www.w3.org/TR/html4/types.html#type-links: Refers to the first document in a collection of documents. This link type tells search engines which document is considered by the author to be the starting point of the collection.
\Zend_Navigation_Page
page to find relation for
\Zend_Navigation_Page
null
page or nullsearchRelSubsection(\Zend_Navigation_Page $page) : \Zend_Navigation_Page | array | null
From http://www.w3.org/TR/html4/types.html#type-links: Refers to a document serving as a subsection in a collection of documents.
\Zend_Navigation_Page
page to find relation for
\Zend_Navigation_Page
array
null
page(s) or nullsearchRevSection(\Zend_Navigation_Page $page) : \Zend_Navigation_Page | null
From http://www.w3.org/TR/html4/types.html#type-links: Refers to a document serving as a section in a collection of documents.
\Zend_Navigation_Page
page to find relation for
\Zend_Navigation_Page
null
page(s) or nullsearchRevSubsection(\Zend_Navigation_Page $page) : \Zend_Navigation_Page | null
From http://www.w3.org/TR/html4/types.html#type-links: Refers to a document serving as a subsection in a collection of documents.
\Zend_Navigation_Page
page to find relation for
\Zend_Navigation_Page
null
page(s) or nullsetAcl(\Zend_Acl $acl = null
) : \Zend_View_Helper_Navigation_HelperAbstract
Implements Zend_View_Helper_Navigation_Helper::setAcl().
inherited_from | \Zend_View_Helper_Navigation_Helper::setAcl() |
---|
\Zend_Acl
[optional] ACL object. Default is null.
\Zend_View_Helper_Navigation_HelperAbstract
fluent interface,
returns selfsetContainer(\Zend_Navigation_Container $container = null
) : \Zend_View_Helper_Navigation_HelperAbstract
Implements \Zend_View_Helper_Navigation_Interface::setContainer().
inherited_from | \Zend_View_Helper_Navigation_Helper::setContainer() |
---|
\Zend_Navigation_Container
[optional] container to operate on. Default is null, meaning container will be reset.
\Zend_View_Helper_Navigation_HelperAbstract
fluent interface,
returns selfsetDefaultAcl(\Zend_Acl $acl = null
) : void
\Zend_Acl
[optional] ACL object. Default is null, which sets no ACL object.
setDefaultRole(mixed $role = null
) : void
mixed
[optional] role to set. Expects null, string, or an instance of {@link Zend_Acl_Role_Interface}. Default is null, which sets no default role.
\Zend_View_Exception |
if role is invalid |
---|
setFormatOutput(boolean $formatOutput = true
) : \Zend_View_Helper_Navigation_Sitemap
boolean
[optional] whether output should be formatted. Default is true.
\Zend_View_Helper_Navigation_Sitemap
fluent interface, returns
selfsetIndent(string|integer $indent) : \Zend_View_Helper_Navigation_HelperAbstract
string
integer
indentation string or number of spaces
\Zend_View_Helper_Navigation_HelperAbstract
fluent interface,
returns selfsetMaxDepth(integer $maxDepth = null
) : \Zend_View_Helper_Navigation_HelperAbstract
integer
[optional] maximum depth. Default is null, which sets no maximum depth.
\Zend_View_Helper_Navigation_HelperAbstract
fluent interface,
returns selfsetMinDepth(integer $minDepth = null
) : \Zend_View_Helper_Navigation_HelperAbstract
integer
[optional] minimum depth. Default is null, which sets no minimum depth.
\Zend_View_Helper_Navigation_HelperAbstract
fluent interface,
returns selfsetPrefixForId(string $prefix) : \Zend_View_Helper_Navigation_HelperAbstract
string
Prefix for IDs
\Zend_View_Helper_Navigation_HelperAbstract
fluent interface, returns selfsetRenderFlag(integer $renderFlag) : \Zend_View_Helper_Navigation_Links
The helper uses the bitwise '&' operator against the hex values of the
render constants. This means that the flag can is "bitwised" value of
the render constants. Examples:
// render all links except glossary
$flag = Zend_View_Helper_Navigation_Links:RENDER_ALL ^
Zend_View_Helper_Navigation_Links:RENDER_GLOSSARY;
$helper->setRenderFlag($flag);
// render only chapters and sections $flag = Zend_View_Helper_Navigation_Links:RENDER_CHAPTER | Zend_View_Helper_Navigation_Links:RENDER_SECTION; $helper->setRenderFlag($flag);
// render only relations that are not native W3C relations $helper->setRenderFlag(Zend_View_Helper_Navigation_Links:RENDER_CUSTOM);
// render all relations (default) $helper->setRenderFlag(Zend_View_Helper_Navigation_Links:RENDER_ALL);
Note that custom relations can also be rendered directly using the \renderLink() method.
integer
render flag
\Zend_View_Helper_Navigation_Links
fluent interface, returns selfsetRenderInvisible(boolean $renderInvisible = true
) : \Zend_View_Helper_Navigation_HelperAbstract
inherited_from | \Zend_View_Helper_Navigation_Helper::setRenderInvisible() |
---|
boolean
[optional] boolean flag
\Zend_View_Helper_Navigation_HelperAbstract
fluent interface
returns selfsetRole(mixed $role = null
) : \Zend_View_Helper_Navigation_HelperAbstract
Implements Zend_View_Helper_Navigation_Helper::setRole().
inherited_from | \Zend_View_Helper_Navigation_Helper::setRole() |
---|
mixed
[optional] role to set. Expects a string, an instance of type {@link Zend_Acl_Role_Interface}, or null. Default is null, which will set no role.
\Zend_View_Exception |
if $role is invalid |
---|
\Zend_View_Helper_Navigation_HelperAbstract
fluent interface,
returns selfsetTranslator(mixed $translator = null
) : \Zend_View_Helper_Navigation_HelperAbstract
inherited_from | \Zend_View_Helper_Navigation_Helper::setTranslator() |
---|
mixed
[optional] translator. Expects an object of type {@link Zend_Translate_Adapter} or {@link Zend_Translate}, or null. Default is null, which sets no translator.
\Zend_View_Helper_Navigation_HelperAbstract
fluent interface,
returns selfsetUseAcl(boolean $useAcl = true
) : \Zend_View_Helper_Navigation_HelperAbstract
Implements Zend_View_Helper_Navigation_Helper::setUseAcl().
inherited_from | \Zend_View_Helper_Navigation_Helper::setUseAcl() |
---|
boolean
[optional] whether ACL should be used. Default is true.
\Zend_View_Helper_Navigation_HelperAbstract
fluent interface,
returns selfsetUseTranslator(boolean $useTranslator = true
) : \Zend_View_Helper_Navigation_HelperAbstract
inherited_from | \Zend_View_Helper_Navigation_Helper::setUseTranslator() |
---|
boolean
[optional] whether translator should be used. Default is true.
\Zend_View_Helper_Navigation_HelperAbstract
fluent interface,
returns selfsetView(\Zend_View_Interface $view) : \Zend_View_Helper_Abstract
inherited_from | \Zend_View_Helper_Interface::setView() |
---|
\Zend_View_Interface
\Zend_View_Helper_Abstract
skipPrefixForId(boolean $flag = true
) : \Zend_View_Helper_Navigation_HelperAbstract
boolean
\Zend_View_Helper_Navigation_HelperAbstract
fluent interface, returns self_acceptAcl(\Zend_Navigation_Page $page) : boolean
Rules:
\Zend_Navigation_Page
page to check
boolean
whether page is accepted by ACL_convertToPages(mixed $mixed, boolean $recursive = true
) : \Zend_Navigation_Page | array | null
mixed
mixed value to get page(s) from
boolean
whether $value should be looped if it is an array or a config
\Zend_Navigation_Page
array
null
empty if unable to convert_findFromProperty(\Zend_Navigation_Page $page, string $rel, string $type) : \Zend_Navigation_Page | array | null
\Zend_Navigation_Page
page to find relations for
string
relation, 'rel' or 'rev'
string
link type, e.g. 'start', 'next'
\Zend_Navigation_Page
array
null
page(s), or null if not found_findFromSearch(\Zend_Navigation_Page $page, string $rel, string $type) : array | null
\Zend_Navigation_Page
page to find relations for
string
relation, 'rel' or 'rev'
string
link type, e.g. 'start', 'next', etc
array
null
array of pages, or null if not found_findRoot(\Zend_Navigaiton_Page $page) : \Zend_Navigation_Container
When rendering a container, the render method still store the given container as the root container, and unset it when done rendering. This makes sure finder methods will not traverse above the container given to the render method.
\Zend_Navigaiton_Page
page to find root for
\Zend_Navigation_Container
the root container of the given page_getWhitespace(integer|string $indent) : string
integer
string
string
_htmlAttribs(array $attribs) : string
access | public |
---|
array
From this array, each key-value pair is converted to an attribute name and value.
string
The XHTML for the attributes._isHtml5() : boolean
boolean
_isStrictDoctype() : boolean
boolean
_isXhtml() : boolean
boolean
_normalizeId(string $value) : string
string
string
$view : \Zend_View_Interface
null
$_RELATIONS : array
array(self::RENDER_ALTERNATE => 'alternate', self::RENDER_STYLESHEET => 'stylesheet', self::RENDER_START => 'start', self::RENDER_NEXT => 'next', self::RENDER_PREV => 'prev', self::RENDER_CONTENTS => 'contents', self::RENDER_INDEX => 'index', self::RENDER_GLOSSARY => 'glossary', self::RENDER_COPYRIGHT => 'copyright', self::RENDER_CHAPTER => 'chapter', self::RENDER_SECTION => 'section', self::RENDER_SUBSECTION => 'subsection', self::RENDER_APPENDIX => 'appendix', self::RENDER_HELP => 'help', self::RENDER_BOOKMARK => 'bookmark')
$_acl : \Zend_Acl
$_closingBracket : string
null
$_container : \Zend_Navigation_Container
$_defaultAcl : \Zend_Acl
$_defaultRole : string | \Zend_Acl_Role_Interface
$_formatOutput : boolean
true
$_indent : string
''
$_maxDepth : integer
$_minDepth : integer
$_prefixForId : string | null
null
$_renderInvisible : boolean
false
$_role : string | \Zend_Acl_Role_Interface
$_root : \Zend_Navigation_Container
$_skipPrefixForId : boolean
false
$_translator : \Zend_Translate_Adapter
$_useAcl : boolean
true
$_useTranslator : boolean
true
EOL = "\n"
RENDER_ALL = 65535
RENDER_ALTERNATE = 1
RENDER_APPENDIX = 4096
RENDER_BOOKMARK = 16384
RENDER_CHAPTER = 512
RENDER_CONTENTS = 32
RENDER_COPYRIGHT = 256
RENDER_CUSTOM = 32768
RENDER_GLOSSARY = 128
RENDER_HELP = 8192
RENDER_INDEX = 64
RENDER_NEXT = 8
RENDER_PREV = 16
RENDER_SECTION = 1024
RENDER_START = 4
RENDER_STYLESHEET = 2
RENDER_SUBSECTION = 2048