PageRenderTime 31ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/Zend/View/Helper/Navigation/Helper.php

https://gitlab.com/blingbang2016/shop
PHP | 212 lines | 24 code | 20 blank | 168 comment | 0 complexity | 673a27dfb10aa4442dfa2951e0ef0c4a MD5 | raw file
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_View
  17. * @subpackage Helper
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * Interface for navigational helpers
  24. *
  25. * @category Zend
  26. * @package Zend_View
  27. * @subpackage Helper
  28. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  29. * @license http://framework.zend.com/license/new-bsd New BSD License
  30. */
  31. interface Zend_View_Helper_Navigation_Helper
  32. {
  33. /**
  34. * Sets navigation container the helper should operate on by default
  35. *
  36. * @param Zend_Navigation_Container $container [optional] container to
  37. * operate on. Default is
  38. * null, which indicates that
  39. * the container should be
  40. * reset.
  41. * @return Zend_View_Helper_Navigation_Helper fluent interface, returns
  42. * self
  43. */
  44. public function setContainer(Zend_Navigation_Container $container = null);
  45. /**
  46. * Returns the navigation container the helper operates on by default
  47. *
  48. * @return Zend_Navigation_Container navigation container
  49. */
  50. public function getContainer();
  51. /**
  52. * Sets translator to use in helper
  53. *
  54. * @param mixed $translator [optional] translator.
  55. * Expects an object of type
  56. * {@link Zend_Translate_Adapter}
  57. * or {@link Zend_Translate},
  58. * or null. Default is null.
  59. * @return Zend_View_Helper_Navigation_Helper fluent interface, returns
  60. * self
  61. */
  62. public function setTranslator($translator = null);
  63. /**
  64. * Returns translator used in helper
  65. *
  66. * @return Zend_Translate_Adapter|null translator or null
  67. */
  68. public function getTranslator();
  69. /**
  70. * Sets ACL to use when iterating pages
  71. *
  72. * @param Zend_Acl $acl [optional] ACL instance
  73. * @return Zend_View_Helper_Navigation_Helper fluent interface, returns
  74. * self
  75. */
  76. public function setAcl(Zend_Acl $acl = null);
  77. /**
  78. * Returns ACL or null if it isn't set using {@link setAcl()} or
  79. * {@link setDefaultAcl()}
  80. *
  81. * @return Zend_Acl|null ACL object or null
  82. */
  83. public function getAcl();
  84. /**
  85. * Sets ACL role to use when iterating pages
  86. *
  87. * @param mixed $role [optional] role to set.
  88. * Expects a string, an
  89. * instance of type
  90. * {@link Zend_Acl_Role_Interface},
  91. * or null. Default is null.
  92. * @throws Zend_View_Exception if $role is invalid
  93. * @return Zend_View_Helper_Navigation_Helper fluent interface, returns
  94. * self
  95. */
  96. public function setRole($role = null);
  97. /**
  98. * Returns ACL role to use when iterating pages, or null if it isn't set
  99. *
  100. * @return string|Zend_Acl_Role_Interface|null role or null
  101. */
  102. public function getRole();
  103. /**
  104. * Sets whether ACL should be used
  105. *
  106. * @param bool $useAcl [optional] whether ACL
  107. * should be used. Default is
  108. * true.
  109. * @return Zend_View_Helper_Navigation_Helper fluent interface, returns
  110. * self
  111. */
  112. public function setUseAcl($useAcl = true);
  113. /**
  114. * Returns whether ACL should be used
  115. *
  116. * @return bool whether ACL should be used
  117. */
  118. public function getUseAcl();
  119. /**
  120. * Return renderInvisible flag
  121. *
  122. * @return bool
  123. */
  124. public function getRenderInvisible();
  125. /**
  126. * Render invisible items?
  127. *
  128. * @param bool $renderInvisible [optional] boolean flag
  129. * @return Zend_View_Helper_Navigation_HelperAbstract fluent interface
  130. * returns self
  131. */
  132. public function setRenderInvisible($renderInvisible = true);
  133. /**
  134. * Sets whether translator should be used
  135. *
  136. * @param bool $useTranslator [optional] whether
  137. * translator should be used.
  138. * Default is true.
  139. * @return Zend_View_Helper_Navigation_Helper fluent interface, returns
  140. * self
  141. */
  142. public function setUseTranslator($useTranslator = true);
  143. /**
  144. * Returns whether translator should be used
  145. *
  146. * @return bool whether translator should be used
  147. */
  148. public function getUseTranslator();
  149. /**
  150. * Checks if the helper has a container
  151. *
  152. * @return bool whether the helper has a container or not
  153. */
  154. public function hasContainer();
  155. /**
  156. * Checks if the helper has an ACL instance
  157. *
  158. * @return bool whether the helper has a an ACL instance or not
  159. */
  160. public function hasAcl();
  161. /**
  162. * Checks if the helper has an ACL role
  163. *
  164. * @return bool whether the helper has a an ACL role or not
  165. */
  166. public function hasRole();
  167. /**
  168. * Checks if the helper has a translator
  169. *
  170. * @return bool whether the helper has a translator or not
  171. */
  172. public function hasTranslator();
  173. /**
  174. * Magic overload: Should proxy to {@link render()}.
  175. *
  176. * @return string
  177. */
  178. public function __toString();
  179. /**
  180. * Renders helper
  181. *
  182. * @param Zend_Navigation_Container $container [optional] container to
  183. * render. Default is null,
  184. * which indicates that the
  185. * helper should render the
  186. * container returned by
  187. * {@link getContainer()}.
  188. * @return string helper output
  189. * @throws Zend_View_Exception if unable to render
  190. */
  191. public function render(Zend_Navigation_Container $container = null);
  192. }