File indexing completed on 2025-05-04 05:28:30
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_View 0017 * @subpackage Helper 0018 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0019 * @license http://framework.zend.com/license/new-bsd New BSD License 0020 * @version $Id$ 0021 */ 0022 0023 /** 0024 * Interface for navigational helpers 0025 * 0026 * @category Zend 0027 * @package Zend_View 0028 * @subpackage Helper 0029 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0030 * @license http://framework.zend.com/license/new-bsd New BSD License 0031 */ 0032 interface Zend_View_Helper_Navigation_Helper 0033 { 0034 /** 0035 * Sets navigation container the helper should operate on by default 0036 * 0037 * @param Zend_Navigation_Container $container [optional] container to 0038 * operate on. Default is 0039 * null, which indicates that 0040 * the container should be 0041 * reset. 0042 * @return Zend_View_Helper_Navigation_Helper fluent interface, returns 0043 * self 0044 */ 0045 public function setContainer(Zend_Navigation_Container $container = null); 0046 0047 /** 0048 * Returns the navigation container the helper operates on by default 0049 * 0050 * @return Zend_Navigation_Container navigation container 0051 */ 0052 public function getContainer(); 0053 0054 /** 0055 * Sets translator to use in helper 0056 * 0057 * @param mixed $translator [optional] translator. 0058 * Expects an object of type 0059 * {@link Zend_Translate_Adapter} 0060 * or {@link Zend_Translate}, 0061 * or null. Default is null. 0062 * @return Zend_View_Helper_Navigation_Helper fluent interface, returns 0063 * self 0064 */ 0065 public function setTranslator($translator = null); 0066 0067 /** 0068 * Returns translator used in helper 0069 * 0070 * @return Zend_Translate_Adapter|null translator or null 0071 */ 0072 public function getTranslator(); 0073 0074 /** 0075 * Sets ACL to use when iterating pages 0076 * 0077 * @param Zend_Acl $acl [optional] ACL instance 0078 * @return Zend_View_Helper_Navigation_Helper fluent interface, returns 0079 * self 0080 */ 0081 public function setAcl(Zend_Acl $acl = null); 0082 0083 /** 0084 * Returns ACL or null if it isn't set using {@link setAcl()} or 0085 * {@link setDefaultAcl()} 0086 * 0087 * @return Zend_Acl|null ACL object or null 0088 */ 0089 public function getAcl(); 0090 0091 /** 0092 * Sets ACL role to use when iterating pages 0093 * 0094 * @param mixed $role [optional] role to set. 0095 * Expects a string, an 0096 * instance of type 0097 * {@link Zend_Acl_Role_Interface}, 0098 * or null. Default is null. 0099 * @throws Zend_View_Exception if $role is invalid 0100 * @return Zend_View_Helper_Navigation_Helper fluent interface, returns 0101 * self 0102 */ 0103 public function setRole($role = null); 0104 0105 /** 0106 * Returns ACL role to use when iterating pages, or null if it isn't set 0107 * 0108 * @return string|Zend_Acl_Role_Interface|null role or null 0109 */ 0110 public function getRole(); 0111 0112 /** 0113 * Sets whether ACL should be used 0114 * 0115 * @param bool $useAcl [optional] whether ACL 0116 * should be used. Default is 0117 * true. 0118 * @return Zend_View_Helper_Navigation_Helper fluent interface, returns 0119 * self 0120 */ 0121 public function setUseAcl($useAcl = true); 0122 0123 /** 0124 * Returns whether ACL should be used 0125 * 0126 * @return bool whether ACL should be used 0127 */ 0128 public function getUseAcl(); 0129 0130 /** 0131 * Return renderInvisible flag 0132 * 0133 * @return bool 0134 */ 0135 public function getRenderInvisible(); 0136 0137 /** 0138 * Render invisible items? 0139 * 0140 * @param bool $renderInvisible [optional] boolean flag 0141 * @return Zend_View_Helper_Navigation_HelperAbstract fluent interface 0142 * returns self 0143 */ 0144 public function setRenderInvisible($renderInvisible = true); 0145 0146 /** 0147 * Sets whether translator should be used 0148 * 0149 * @param bool $useTranslator [optional] whether 0150 * translator should be used. 0151 * Default is true. 0152 * @return Zend_View_Helper_Navigation_Helper fluent interface, returns 0153 * self 0154 */ 0155 public function setUseTranslator($useTranslator = true); 0156 0157 /** 0158 * Returns whether translator should be used 0159 * 0160 * @return bool whether translator should be used 0161 */ 0162 public function getUseTranslator(); 0163 0164 /** 0165 * Checks if the helper has a container 0166 * 0167 * @return bool whether the helper has a container or not 0168 */ 0169 public function hasContainer(); 0170 0171 /** 0172 * Checks if the helper has an ACL instance 0173 * 0174 * @return bool whether the helper has a an ACL instance or not 0175 */ 0176 public function hasAcl(); 0177 0178 /** 0179 * Checks if the helper has an ACL role 0180 * 0181 * @return bool whether the helper has a an ACL role or not 0182 */ 0183 public function hasRole(); 0184 0185 /** 0186 * Checks if the helper has a translator 0187 * 0188 * @return bool whether the helper has a translator or not 0189 */ 0190 public function hasTranslator(); 0191 0192 /** 0193 * Magic overload: Should proxy to {@link render()}. 0194 * 0195 * @return string 0196 */ 0197 public function __toString(); 0198 0199 /** 0200 * Renders helper 0201 * 0202 * @param Zend_Navigation_Container $container [optional] container to 0203 * render. Default is null, 0204 * which indicates that the 0205 * helper should render the 0206 * container returned by 0207 * {@link getContainer()}. 0208 * @return string helper output 0209 * @throws Zend_View_Exception if unable to render 0210 */ 0211 public function render(Zend_Navigation_Container $container = null); 0212 }