Public Member Functions | Protected Attributes

Robo47_View_Helper_Anchor Class Reference

List of all members.

Public Member Functions

 __construct (Zend_Controller_Router_Interface $router=null)
 anchor (array $urlOptions, $name, $linkname, $params=array(), $reset=false, $encode=true)
 Generates an anchor for a given Route.
 getRouter ()
 Returns the used Router.
 setRouter (Zend_Controller_Router_Interface $router=null)
 Sets the used Router.

Protected Attributes

 $_router = null

Detailed Description

Definition at line 31 of file Anchor.php.


Constructor & Destructor Documentation

Robo47_View_Helper_Anchor::__construct ( Zend_Controller_Router_Interface $  router = null  ) 
Parameters:
Zend_Controller_Router_Interface $router

Definition at line 43 of file Anchor.php.

References setRouter().

    {
        $this->setRouter($router);
    }

Here is the call graph for this function:


Member Function Documentation

Robo47_View_Helper_Anchor::anchor ( array $  urlOptions,
name,
linkname,
params = array(),
reset = false,
encode = true 
)

Generates an anchor for a given Route.

Parameters:
array $urlOptions Options passed to the assemble method of the Route object.
mixed $name The name of a Route to use.
string $linkname The name of the Link
array $params Additional html-attributes for the anchor
bool $reset Whether or not to reset the route defaults with those provided
boolean $encode
Returns:
string Complete anchor

Definition at line 87 of file Anchor.php.

    {
        $router = $this->_router;
        $href = $router->assemble($urlOptions, $name, $reset, $encode);
        $link = '<a href="' . $href . '"';
        $link .= $this->_htmlAttribs($params);
        $link .= '>' . $linkname . '</a>';
        return $link;
    }

Robo47_View_Helper_Anchor::getRouter (  ) 

Returns the used Router.

Returns:
Zend_Controller_Router_Interface

Definition at line 69 of file Anchor.php.

    {
        return $this->_router;
    }

Robo47_View_Helper_Anchor::setRouter ( Zend_Controller_Router_Interface $  router = null  ) 

Sets the used Router.

Parameters:
Zend_Controller_Router_Interface $router
Returns:
Robo47_View_Helper_Anchor *Provides Fluent Interface*

Definition at line 54 of file Anchor.php.

Referenced by __construct().

    {
        if (null === $router) {
            $this->_router = Zend_Controller_Front::getInstance()->getRouter();
        } else {
            $this->_router = $router;
        }
        return $this;
    }

Here is the caller graph for this function:


Member Data Documentation

Robo47_View_Helper_Anchor::$_router = null [protected]

Definition at line 37 of file Anchor.php.


The documentation for this class was generated from the following file: