/packages/RewriteURL/RewriteURL/SmartyPlugins/modifier.glink.php

https://bitbucket.org/alexamiryan/stingle · PHP · 22 lines · 10 code · 3 blank · 9 comment · 1 complexity · 5a3eb2c00d8a29b51bdefaa71ff9b525 MD5 · raw file

  1. <?php
  2. /**
  3. * Make link string from given formatted string.
  4. * If OUTPUT_LINK_STYLE is
  5. *
  6. * @param string $string
  7. * @param boolean $with_gets $_GET parametrs to the end
  8. * @param string $exclude param from $_GET. (should be coma separated)
  9. * @return string
  10. */
  11. function smarty_modifier_glink($link, $with_gets = false, $exclude = ''){
  12. $exclude = explode(",", $exclude);
  13. if($with_gets){
  14. RewriteURL::ensureLastSlash($link);
  15. $link .= getAllGetParams($exclude);
  16. }
  17. $link = Reg::get('rewriteURL')->glink($link);
  18. return $link;
  19. }