1<?php 2/** 3 * Zend Framework (http://framework.zend.com/) 4 * 5 * @link http://github.com/zendframework/zf2 for the canonical source repository 6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 7 * @license http://framework.zend.com/license/new-bsd New BSD License 8 */ 9 10namespace Zend\View\Helper\Navigation; 11 12use Zend\Navigation; 13use Zend\Permissions\Acl; 14use Zend\View\Helper\HelperInterface as BaseHelperInterface; 15 16/** 17 * Interface for navigational helpers 18 */ 19interface HelperInterface extends BaseHelperInterface 20{ 21 /** 22 * Magic overload: Should proxy to {@link render()}. 23 * 24 * @return string 25 */ 26 public function __toString(); 27 28 /** 29 * Renders helper 30 * 31 * @param string|Navigation\AbstractContainer $container [optional] container to render. 32 * Default is null, which indicates 33 * that the helper should render 34 * the container returned by {@link 35 * getContainer()}. 36 * @return string helper output 37 * @throws \Zend\View\Exception\ExceptionInterface 38 */ 39 public function render($container = null); 40 41 /** 42 * Sets ACL to use when iterating pages 43 * 44 * @param Acl\AclInterface $acl [optional] ACL instance 45 * @return HelperInterface 46 */ 47 public function setAcl(Acl\AclInterface $acl = null); 48 49 /** 50 * Returns ACL or null if it isn't set using {@link setAcl()} or 51 * {@link setDefaultAcl()} 52 * 53 * @return Acl\AclInterface|null 54 */ 55 public function getAcl(); 56 57 /** 58 * Checks if the helper has an ACL instance 59 * 60 * @return bool 61 */ 62 public function hasAcl(); 63 64 /** 65 * Sets navigation container the helper should operate on by default 66 * 67 * @param string|Navigation\AbstractContainer $container [optional] container to operate 68 * on. Default is null, which 69 * indicates that the container 70 * should be reset. 71 * @return HelperInterface 72 */ 73 public function setContainer($container = null); 74 75 /** 76 * Returns the navigation container the helper operates on by default 77 * 78 * @return Navigation\AbstractContainer navigation container 79 */ 80 public function getContainer(); 81 82 /** 83 * Checks if the helper has a container 84 * 85 * @return bool 86 */ 87 public function hasContainer(); 88 89 /** 90 * Render invisible items? 91 * 92 * @param bool $renderInvisible [optional] boolean flag 93 * @return HelperInterface 94 */ 95 public function setRenderInvisible($renderInvisible = true); 96 97 /** 98 * Return renderInvisible flag 99 * 100 * @return bool 101 */ 102 public function getRenderInvisible(); 103 104 /** 105 * Sets ACL role to use when iterating pages 106 * 107 * @param mixed $role [optional] role to set. Expects a string, an 108 * instance of type {@link Acl\Role}, or null. Default 109 * is null. 110 * @throws \Zend\View\Exception\ExceptionInterface if $role is invalid 111 * @return HelperInterface 112 */ 113 public function setRole($role = null); 114 115 /** 116 * Returns ACL role to use when iterating pages, or null if it isn't set 117 * 118 * @return string|Acl\Role\RoleInterface|null 119 */ 120 public function getRole(); 121 122 /** 123 * Checks if the helper has an ACL role 124 * 125 * @return bool 126 */ 127 public function hasRole(); 128 129 /** 130 * Sets whether ACL should be used 131 * 132 * @param bool $useAcl [optional] whether ACL should be used. Default is true. 133 * @return HelperInterface 134 */ 135 public function setUseAcl($useAcl = true); 136 137 /** 138 * Returns whether ACL should be used 139 * 140 * @return bool 141 */ 142 public function getUseAcl(); 143} 144