Zend Framework
1.12
|
Public Member Functions | |
links (Zend_Navigation_Container $container=null) | |
View helper entry point: Retrieves helper and optionally sets container to operate on. | |
__call ($method, array $arguments=array()) | |
Magic overload: Proxy calls to findRelation() or container. | |
setRenderFlag ($renderFlag) | |
Sets the helper's render flag. | |
getRenderFlag () | |
Returns the helper's render flag. | |
findAllRelations (Zend_Navigation_Page $page, $flag=null) | |
Finds all relations (forward and reverse) for the given $page. | |
findRelation (Zend_Navigation_Page $page, $rel, $type) | |
Finds relations of the given $rel=$type from $page. | |
searchRelStart (Zend_Navigation_Page $page) | |
Searches the root container for the forward 'start' relation of the given $page. | |
searchRelNext (Zend_Navigation_Page $page) | |
Searches the root container for the forward 'next' relation of the given $page. | |
searchRelPrev (Zend_Navigation_Page $page) | |
Searches the root container for the forward 'prev' relation of the given $page. | |
searchRelChapter (Zend_Navigation_Page $page) | |
Searches the root container for forward 'chapter' relations of the given $page. | |
searchRelSection (Zend_Navigation_Page $page) | |
Searches the root container for forward 'section' relations of the given $page. | |
searchRelSubsection (Zend_Navigation_Page $page) | |
Searches the root container for forward 'subsection' relations of the given $page. | |
searchRevSection (Zend_Navigation_Page $page) | |
Searches the root container for the reverse 'section' relation of the given $page. | |
searchRevSubsection (Zend_Navigation_Page $page) | |
Searches the root container for the reverse 'section' relation of the given $page. | |
renderLink (Zend_Navigation_Page $page, $attrib, $relation) | |
Renders the given $page as a link element, with $attrib = $relation. | |
render (Zend_Navigation_Container $container=null) | |
Renders helper. | |
![]() | |
setContainer (Zend_Navigation_Container $container=null) | |
Sets navigation container the helper operates on by default. | |
getContainer () | |
Returns the navigation container helper operates on by default. | |
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. | |
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. | |
setIndent ($indent) | |
Set the indentation string for using in render(), optionally a number of spaces to indent with. | |
getIndent () | |
Returns indentation (format output is respected) | |
getEOL () | |
Returns the EOL character (format output is respected) | |
setFormatOutput ($formatOutput=true) | |
Sets whether HTML/XML output should be formatted. | |
getFormatOutput () | |
Returns whether HTML/XML output should be formatted. | |
setPrefixForId ($prefix) | |
Sets prefix for IDs when they are normalized. | |
getPrefixForId () | |
Returns prefix for IDs when they are normalized. | |
skipPrefixForId ($flag=true) | |
Skip the current prefix for IDs when they are normalized. | |
setTranslator ($translator=null) | |
Sets translator to use in helper. | |
getTranslator () | |
Returns translator used in helper. | |
setAcl (Zend_Acl $acl=null) | |
Sets ACL to use when iterating pages. | |
getAcl () | |
Returns ACL or null if it isn't set using setAcl() or setDefaultAcl(). | |
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(). | |
setUseAcl ($useAcl=true) | |
Sets whether ACL should be used. | |
getUseAcl () | |
Returns whether ACL should be used. | |
getRenderInvisible () | |
Return renderInvisible flag. | |
setRenderInvisible ($renderInvisible=true) | |
Render invisible items? | |
setUseTranslator ($useTranslator=true) | |
Sets whether translator should be used. | |
getUseTranslator () | |
Returns whether translator should be used. | |
__call ($method, array $arguments=array()) | |
Magic overload: Proxy calls to the navigation container. | |
__toString () | |
Magic overload: Proxy to render(). | |
findActive (Zend_Navigation_Container $container, $minDepth=null, $maxDepth=-1) | |
Finds the deepest active page in the given container. | |
hasContainer () | |
Checks if the helper has a container. | |
hasAcl () | |
Checks if the helper has an ACL instance. | |
hasRole () | |
Checks if the helper has an ACL role. | |
hasTranslator () | |
Checks if the helper has a translator. | |
htmlify (Zend_Navigation_Page $page) | |
Returns an HTML string containing an 'a' element for the given page. | |
accept (Zend_Navigation_Page $page, $recursive=true) | |
Determines whether a page should be accepted when iterating. | |
![]() | |
getClosingBracket () | |
Get the tag closing bracket. | |
![]() | |
setView (Zend_View_Interface $view) | |
Set the View object. | |
direct () | |
Strategy pattern: currently unutilized. | |
Public Attributes | |
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 |
Protected Member Functions | |
_findFromProperty (Zend_Navigation_Page $page, $rel, $type) | |
Finds relations of given $type for $page by checking if the relation is specified as a property of $page. | |
_findFromSearch (Zend_Navigation_Page $page, $rel, $type) | |
Finds relations of given $rel=$type for $page by using the helper to search for the relation in the root container. | |
_findRoot (Zend_Navigation_Page $page) | |
Returns the root container of the given page. | |
_convertToPages ($mixed, $recursive=true) | |
Converts a $mixed value to an array of pages. | |
![]() | |
_acceptAcl (Zend_Navigation_Page $page) | |
Determines whether a page should be accepted by ACL when iterating. | |
_getWhitespace ($indent) | |
Retrieve whitespace representation of $indent. | |
_htmlAttribs ($attribs) | |
Converts an associative array to a string of tag attributes. | |
_normalizeId ($value) | |
Normalize an ID. | |
![]() | |
_isXhtml () | |
Is doctype XHTML? | |
_isHtml5 () | |
Is doctype HTML5? | |
_isStrictDoctype () | |
Is doctype strict? | |
_htmlAttribs ($attribs) | |
Converts an associative array to a string of tag attributes. | |
_normalizeId ($value) | |
Normalize an ID. | |
Protected Attributes | |
$_renderFlag = self::RENDER_ALL | |
$_root | |
![]() | |
$_container | |
$_minDepth | |
$_maxDepth | |
$_indent = '' | |
$_formatOutput = true | |
$_prefixForId = null | |
$_skipPrefixForId = false | |
$_translator | |
$_acl | |
$_renderInvisible = false | |
$_role | |
$_useTranslator = true | |
$_useAcl = true | |
![]() | |
$_closingBracket = null | |
Static Protected Attributes | |
static | $_RELATIONS |
![]() | |
static | $_defaultAcl |
static | $_defaultRole |
Additional Inherited Members | |
![]() | |
static | setDefaultAcl (Zend_Acl $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(). | |
__call | ( | $method, | |
array | $arguments = array() |
||
) |
Magic overload: Proxy calls to findRelation() or container.
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');
string | $method | method name |
array | $arguments | method arguments |
Zend_Navigation_Exception | if method does not exist in container |
|
protected |
Converts a $mixed value to an array of pages.
mixed | $mixed | mixed value to get page(s) from |
bool | $recursive | whether $value should be looped if it is an array or a config |
|
protected |
Finds relations of given $type for $page by checking if the relation is specified as a property of $page.
Zend_Navigation_Page | $page | page to find relations for |
string | $rel | relation, 'rel' or 'rev' |
string | $type | link type, e.g. 'start', 'next' |
|
protected |
Finds relations of given $rel=$type for $page by using the helper to search for the relation in the root container.
Zend_Navigation_Page | $page | page to find relations for |
string | $rel | relation, 'rel' or 'rev' |
string | $type | link type, e.g. 'start', 'next', etc |
|
protected |
Returns the root container of the given page.
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 | page to find root for |
findAllRelations | ( | Zend_Navigation_Page | $page, |
$flag = null |
|||
) |
Finds all relations (forward and reverse) for the given $page.
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 | page to find links for |
findRelation | ( | Zend_Navigation_Page | $page, |
$rel, | |||
$type | |||
) |
Finds relations of the given $rel=$type from $page.
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 | page to find relations for |
string | $rel | relation, "rel" or "rev" |
string | $type | link type, e.g. 'start', 'next' |
Zend_View_Exception | if $rel is not "rel" or "rev" |
getRenderFlag | ( | ) |
Returns the helper's render flag.
links | ( | Zend_Navigation_Container | $container = null | ) |
View helper entry point: Retrieves helper and optionally sets container to operate on.
Zend_Navigation_Container | $container | [optional] container to operate on |
render | ( | Zend_Navigation_Container | $container = null | ) |
Renders helper.
Implements Zend_View_Helper_Navigation_Helper::render().
Zend_Navigation_Container | $container | [optional] container to render. Default is to render the container registered in the helper. |
Implements Zend_View_Helper_Navigation_Helper.
renderLink | ( | Zend_Navigation_Page | $page, |
$attrib, | |||
$relation | |||
) |
Renders the given $page as a link element, with $attrib = $relation.
Zend_Navigation_Page | $page | the page to render the link for |
string | $attrib | the attribute to use for $type, either 'rel' or 'rev' |
string | $relation | 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 |
searchRelChapter | ( | Zend_Navigation_Page | $page | ) |
Searches the root container for forward 'chapter' relations of the given $page.
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 | page to find relation for |
searchRelNext | ( | Zend_Navigation_Page | $page | ) |
Searches the root container for the forward 'next' relation of the given $page.
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 | page to find relation for |
searchRelPrev | ( | Zend_Navigation_Page | $page | ) |
Searches the root container for the forward 'prev' relation of the given $page.
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 | page to find relation for |
searchRelSection | ( | Zend_Navigation_Page | $page | ) |
Searches the root container for forward 'section' relations of the given $page.
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 | page to find relation for |
searchRelStart | ( | Zend_Navigation_Page | $page | ) |
Searches the root container for the forward 'start' relation of the given $page.
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 | page to find relation for |
searchRelSubsection | ( | Zend_Navigation_Page | $page | ) |
Searches the root container for forward 'subsection' relations of the given $page.
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 | page to find relation for |
searchRevSection | ( | Zend_Navigation_Page | $page | ) |
Searches the root container for the reverse 'section' relation of the given $page.
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 | page to find relation for |
searchRevSubsection | ( | Zend_Navigation_Page | $page | ) |
Searches the root container for the reverse 'section' relation of the given $page.
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 | page to find relation for |
setRenderFlag | ( | $renderFlag | ) |
Sets the helper's render flag.
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.
int | $renderFlag | render flag |
|
staticprotected |
|
protected |
|
protected |
const RENDER_ALL = 0xffff |
const RENDER_ALTERNATE = 0x0001 |
const RENDER_APPENDIX = 0x1000 |
const RENDER_BOOKMARK = 0x4000 |
const RENDER_CHAPTER = 0x0200 |
const RENDER_CONTENTS = 0x0020 |
const RENDER_COPYRIGHT = 0x0100 |
const RENDER_CUSTOM = 0x8000 |
const RENDER_GLOSSARY = 0x0080 |
const RENDER_HELP = 0x2000 |
const RENDER_INDEX = 0x0040 |
const RENDER_NEXT = 0x0008 |
const RENDER_PREV = 0x0010 |
const RENDER_SECTION = 0x0400 |
const RENDER_START = 0x0004 |
const RENDER_STYLESHEET = 0x0002 |
const RENDER_SUBSECTION = 0x0800 |