Class Zend_View_Helper_Navigation_Links

Description

Helper for printing <link> elements

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /View/Helper/Navigation/Links.php (line 37)

Zend_View_Helper_Abstract
   |
   --Zend_View_Helper_HtmlElement
      |
      --Zend_View_Helper_Navigation_HelperAbstract
         |
         --Zend_View_Helper_Navigation_Links
Class Constant Summary
 RENDER_ALL = 0xffff
 RENDER_ALTERNATE = 0x0001
 RENDER_APPENDIX = 0x1000
 RENDER_BOOKMARK = 0x4000
 RENDER_CHAPTER = 0x0200
 RENDER_CONTENTS = 0x0020
 RENDER_COPYRIGHT = 0x0100
 RENDER_CUSTOM = 0x8000
 RENDER_GLOSSARY = 0x0080
 RENDER_HELP = 0x2000
 RENDER_INDEX = 0x0040
 RENDER_NEXT = 0x0008
 RENDER_PREV = 0x0010
 RENDER_SECTION = 0x0400
 RENDER_START = 0x0004
Variable Summary
Method Summary
 array findAllRelations ( $page, [ $flag = null])
 Zend_Navigaiton_Page|array|null findRelation ( $page, string $rel, string $type)
 int getRenderFlag ()
 Zend_View_Helper_Navigation_Links links ([ $container = null])
 string render ([ $container = null])
 string renderLink ( $page, string $attrib, string $relation)
 Zend_Navigation_Page|array|null searchRelChapter ( $page)
 Zend_Navigation_Page|array|null searchRelSection ( $page)
 Zend_Navigation_Page|array|null _convertToPages (mixed $mixed, [bool $recursive = true])
 Zend_Navigation_Page|array|null _findFromProperty ( $page, string $rel, string $type)
 array|null _findFromSearch ( $page, string $rel, string $type)
 void __call (string $method, [ $arguments = array()])
Variables
static array $_RELATIONS = 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'
)
(line 69)

Maps render constants to W3C link types

  • access: protected
int $_renderFlag = self::RENDER_ALL (line 94)

The helper's render flag

Zend_Navigation_Container $_root (line 106)

Root container

Used for preventing methods to traverse above the container given to the render() method.

Inherited Variables

Inherited from Zend_View_Helper_Navigation_HelperAbstract

Zend_View_Helper_Navigation_HelperAbstract::$_acl
Zend_View_Helper_Navigation_HelperAbstract::$_container
Zend_View_Helper_Navigation_HelperAbstract::$_defaultAcl
Zend_View_Helper_Navigation_HelperAbstract::$_defaultRole
Zend_View_Helper_Navigation_HelperAbstract::$_indent
Zend_View_Helper_Navigation_HelperAbstract::$_maxDepth
Zend_View_Helper_Navigation_HelperAbstract::$_minDepth
Zend_View_Helper_Navigation_HelperAbstract::$_renderInvisible
Zend_View_Helper_Navigation_HelperAbstract::$_role
Zend_View_Helper_Navigation_HelperAbstract::$_translator
Zend_View_Helper_Navigation_HelperAbstract::$_useAcl
Zend_View_Helper_Navigation_HelperAbstract::$_useTranslator

Inherited from Zend_View_Helper_HtmlElement

Zend_View_Helper_HtmlElement::$_closingBracket

Inherited from Zend_View_Helper_Abstract

Zend_View_Helper_Abstract::$view
Methods
findAllRelations (line 225)

Finds all relations (forward and reverse) for the given $page

The form of the returned array:

  1.  // $page denotes an instance of Zend_Navigation_Page
  2.  $returned array(
  3.      'rel' => array(
  4.          'alternate' => array($page$page$page),
  5.          'start'     => array($page),
  6.          'next'      => array($page),
  7.          'prev'      => array($page),
  8.          'canonical' => array($page)
  9.      ),
  10.      'rev' => array(
  11.          'section'   => array($page)
  12.      )
  13.  );

  • return: related pages
  • access: public
array findAllRelations ( $page, [ $flag = null])
findRelation (line 270)

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.

  • return: page(s), or null if not found
  • throws: Zend_View_Exception if $rel is not "rel" or "rev"
  • access: public
Zend_Navigaiton_Page|array|null findRelation ( $page, string $rel, string $type)
  • Zend_Navigation_Page $page: page to find relations for
  • string $rel: relation, "rel" or "rev"
  • string $type: link type, e.g. 'start', 'next'
getRenderFlag (line 195)

Returns the helper's render flag

  • return: render flag
  • access: public
int getRenderFlag ()
links (line 117)

View helper entry point: Retrieves helper and optionally sets container to operate on

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_Links links ([ $container = null])
render (line 750)

Renders helper

Implements Zend_View_Helper_Navigation_Helper::render().

  • return: helper output
  • access: public
string render ([ $container = null])
  • Zend_Navigation_Container $container: [optional] container to render. Default is to render the container registered in the helper.
renderLink (line 709)

Renders the given $page as a link element, with $attrib = $relation

  • return: rendered link element
  • throws: Zend_View_Exception if $attrib is invalid
  • access: public
string renderLink ( $page, string $attrib, string $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
searchRelChapter (line 446)

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.

  • return: page(s) or null
  • access: public
Zend_Navigation_Page|array|null searchRelChapter ( $page)
searchRelNext (line 381)

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.

  • return: page(s) or null
  • access: public
Zend_Navigation_Page|null searchRelNext ( $page)
searchRelPrev (line 414)

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".

  • return: page or null
  • access: public
Zend_Navigation_Page|null searchRelPrev ( $page)
searchRelSection (line 488)

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.

  • return: page(s) or null
  • access: public
Zend_Navigation_Page|array|null searchRelSection ( $page)
searchRelStart (line 354)

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.

  • return: page or null
  • access: public
Zend_Navigation_Page|null searchRelStart ( $page)
searchRelSubsection (line 522)

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.

  • return: page(s) or null
  • access: public
Zend_Navigation_Page|array|null searchRelSubsection ( $page)
searchRevSection (line 560)

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.

  • return: page(s) or null
  • access: public
Zend_Navigation_Page|null searchRevSection ( $page)
searchRevSubsection (line 585)

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.

  • return: page(s) or null
  • access: public
Zend_Navigation_Page|null searchRevSubsection ( $page)
setRenderFlag (line 184)

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:

  1.  // render all links except glossary
  2.  $helper->setRenderFlag($flag);
  3.  
  4.  // render only chapters and sections
  5.  $helper->setRenderFlag($flag);
  6.  
  7.  // render only relations that are not native W3C relations
  8.  
  9.  // render all relations (default)

Note that custom relations can also be rendered directly using the renderLink() method.

  • return: fluent interface, returns self
  • access: public
Zend_View_Helper_Navigation_Links setRenderFlag (int $renderFlag)
  • int $renderFlag: render flag
_convertToPages (line 645)

Converts a $mixed value to an array of pages

  • return: empty if unable to convert
  • access: protected
Zend_Navigation_Page|array|null _convertToPages (mixed $mixed, [bool $recursive = true])
  • mixed $mixed: mixed value to get page(s) from
  • bool $recursive: whether $value should be looped if it is an array or a config
_findFromProperty (line 297)

Finds relations of given $type for $page by checking if the relation is specified as a property of $page

  • return: page(s), or null if not found
  • access: protected
Zend_Navigation_Page|array|null _findFromProperty ( $page, string $rel, string $type)
  • Zend_Navigation_Page $page: page to find relations for
  • string $rel: relation, 'rel' or 'rev'
  • string $type: link type, e.g. 'start', 'next'
_findFromSearch (line 328)

Finds relations of given $rel=$type for $page by using the helper to search for the relation in the root container

  • return: array of pages, or null if not found
  • access: protected
array|null _findFromSearch ( $page, string $rel, string $type)
  • Zend_Navigation_Page $page: page to find relations for
  • string $rel: relation, 'rel' or 'rev'
  • string $type: link type, e.g. 'start', 'next', etc
_findRoot (line 617)

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.

  • return: the root container of the given page
  • access: protected
Zend_Navigation_Container _findRoot ( $page)
  • Zend_Navigaiton_Page $page: page to find root for
__call (line 141)

Magic overload: Proxy calls to findRelation() or container

Examples of finder calls:

  1.  // METHOD                  // SAME AS
  2.  $h->findRelNext($page);    // $h->findRelation($page, 'rel', 'next')
  3.  $h->findRevSection($page)// $h->findRelation($page, 'rev', 'section');
  4.  $h->findRelFoo($page);     // $h->findRelation($page, 'rel', 'foo');

  • throws: Zend_Navigation_Exception if method does not exist in container
  • access: public
void __call (string $method, [ $arguments = array()])
  • string $method: method name
  • array $arguments: method arguments

Redefinition of:
Zend_View_Helper_Navigation_HelperAbstract::__call()
Magic overload: Proxy calls to the navigation container

Inherited Methods

Inherited From Zend_View_Helper_Navigation_HelperAbstract

 Zend_View_Helper_Navigation_HelperAbstract::accept()
 Zend_View_Helper_Navigation_HelperAbstract::findActive()
 Zend_View_Helper_Navigation_HelperAbstract::getAcl()
 Zend_View_Helper_Navigation_HelperAbstract::getContainer()
 Zend_View_Helper_Navigation_HelperAbstract::getIndent()
 Zend_View_Helper_Navigation_HelperAbstract::getMaxDepth()
 Zend_View_Helper_Navigation_HelperAbstract::getMinDepth()
 Zend_View_Helper_Navigation_HelperAbstract::getRenderInvisible()
 Zend_View_Helper_Navigation_HelperAbstract::getRole()
 Zend_View_Helper_Navigation_HelperAbstract::getTranslator()
 Zend_View_Helper_Navigation_HelperAbstract::getUseAcl()
 Zend_View_Helper_Navigation_HelperAbstract::getUseTranslator()
 Zend_View_Helper_Navigation_HelperAbstract::hasAcl()
 Zend_View_Helper_Navigation_HelperAbstract::hasContainer()
 Zend_View_Helper_Navigation_HelperAbstract::hasRole()
 Zend_View_Helper_Navigation_HelperAbstract::hasTranslator()
 Zend_View_Helper_Navigation_HelperAbstract::htmlify()
 Zend_View_Helper_Navigation_HelperAbstract::setAcl()
 Zend_View_Helper_Navigation_HelperAbstract::setContainer()
 Zend_View_Helper_Navigation_HelperAbstract::setDefaultAcl()
 Zend_View_Helper_Navigation_HelperAbstract::setDefaultRole()
 Zend_View_Helper_Navigation_HelperAbstract::setIndent()
 Zend_View_Helper_Navigation_HelperAbstract::setMaxDepth()
 Zend_View_Helper_Navigation_HelperAbstract::setMinDepth()
 Zend_View_Helper_Navigation_HelperAbstract::setRenderInvisible()
 Zend_View_Helper_Navigation_HelperAbstract::setRole()
 Zend_View_Helper_Navigation_HelperAbstract::setTranslator()
 Zend_View_Helper_Navigation_HelperAbstract::setUseAcl()
 Zend_View_Helper_Navigation_HelperAbstract::setUseTranslator()
 Zend_View_Helper_Navigation_HelperAbstract::_acceptAcl()
 Zend_View_Helper_Navigation_HelperAbstract::_getWhitespace()
 Zend_View_Helper_Navigation_HelperAbstract::_htmlAttribs()
 Zend_View_Helper_Navigation_HelperAbstract::_normalizeId()
 Zend_View_Helper_Navigation_HelperAbstract::__call()
 Zend_View_Helper_Navigation_HelperAbstract::__toString()

Inherited From Zend_View_Helper_HtmlElement

 Zend_View_Helper_HtmlElement::getClosingBracket()
 Zend_View_Helper_HtmlElement::_htmlAttribs()
 Zend_View_Helper_HtmlElement::_isXhtml()
 Zend_View_Helper_HtmlElement::_normalizeId()

Inherited From Zend_View_Helper_Abstract

 Zend_View_Helper_Abstract::direct()
 Zend_View_Helper_Abstract::setView()
Class Constants
RENDER_ALL = 0xffff (line 61)

Constants used for specifying which link types to find and render

RENDER_ALTERNATE = 0x0001 (line 45)

Constants used for specifying which link types to find and render

RENDER_APPENDIX = 0x1000 (line 57)

Constants used for specifying which link types to find and render

RENDER_BOOKMARK = 0x4000 (line 59)

Constants used for specifying which link types to find and render

RENDER_CHAPTER = 0x0200 (line 54)

Constants used for specifying which link types to find and render

RENDER_CONTENTS = 0x0020 (line 50)

Constants used for specifying which link types to find and render

RENDER_COPYRIGHT = 0x0100 (line 53)

Constants used for specifying which link types to find and render

RENDER_CUSTOM = 0x8000 (line 60)

Constants used for specifying which link types to find and render

RENDER_GLOSSARY = 0x0080 (line 52)

Constants used for specifying which link types to find and render

RENDER_HELP = 0x2000 (line 58)

Constants used for specifying which link types to find and render

RENDER_INDEX = 0x0040 (line 51)

Constants used for specifying which link types to find and render

RENDER_NEXT = 0x0008 (line 48)

Constants used for specifying which link types to find and render

RENDER_PREV = 0x0010 (line 49)

Constants used for specifying which link types to find and render

RENDER_SECTION = 0x0400 (line 55)

Constants used for specifying which link types to find and render

RENDER_START = 0x0004 (line 47)

Constants used for specifying which link types to find and render

RENDER_STYLESHEET = 0x0002 (line 46)

Constants used for specifying which link types to find and render

RENDER_SUBSECTION = 0x0800 (line 56)

Constants used for specifying which link types to find and render

Inherited Constants

Inherited from Zend_View_Helper_HtmlElement

Zend_View_Helper_HtmlElement::EOL

Documentation generated on Mon, 21 Jun 2010 15:31:07 -0400 by phpDocumentor 1.4.3