UrlWriter.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /** @package verysimple::HTTP */
  3. require_once("verysimple/Phreeze/ActionRouter.php");
  4. require_once("verysimple/HTTP/RequestUtil.php");
  5. /**
  6. * class for dealing with URLs
  7. *
  8. * @package verysimple::HTTP
  9. * @author VerySimple Inc.
  10. * @copyright 1997-2007 VerySimple, Inc. http://www.verysimple.com
  11. * @license http://www.gnu.org/licenses/lgpl.html LGPL
  12. * @version 1.0
  13. */
  14. class UrlWriter extends ActionRouter
  15. {
  16. /** Returns a url for the given controller, method and parameters
  17. *
  18. * @param string $controller
  19. * @param string $method
  20. * @param string $params in the format param1=val1&param2=val2
  21. * @param bool $strip_api set to true to strip virtual part of the url in a rest call
  22. * @param string $delim the querystring variable delimiter (& or &amp; for generating valid html)
  23. * @return string URL
  24. */
  25. public function Get($controller, $method, $params = "", $strip_api = true, $delim="&")
  26. {
  27. $this->stripApi = $strip_api;
  28. $this->delim = $delim;
  29. return $this->GetUrl($controller, $method, $params);
  30. }
  31. }
  32. ?>