summaryrefslogtreecommitdiffstats
path: root/lib/public/iurlgenerator.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-09-26 18:41:19 +0200
committerBart Visscher <bartv@thisnet.nl>2013-10-04 18:11:02 +0200
commit61a9098b7d88656d0297a18c1b7685c04d1c64dc (patch)
tree085e22056dcf0bfdfd50468398bcdd367b8bd224 /lib/public/iurlgenerator.php
parentce9436c0518d8ce522646dde33dbac141cc35c46 (diff)
downloadnextcloud-server-61a9098b7d88656d0297a18c1b7685c04d1c64dc.tar.gz
nextcloud-server-61a9098b7d88656d0297a18c1b7685c04d1c64dc.zip
Add Helper and URLGenerator interfaces to server container
Diffstat (limited to 'lib/public/iurlgenerator.php')
-rw-r--r--lib/public/iurlgenerator.php47
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/public/iurlgenerator.php b/lib/public/iurlgenerator.php
new file mode 100644
index 00000000000..4eb4c0f8312
--- /dev/null
+++ b/lib/public/iurlgenerator.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ *
+ */
+
+namespace OCP;
+
+/**
+ * Class to generate URLs
+ */
+interface IURLGenerator {
+ /**
+ * Returns the URL for a route
+ * @param string $routeName the name of the route
+ * @param array $arguments an array with arguments which will be filled into the url
+ * @return string the url
+ */
+ public function linkToRoute($routeName, $arguments = array());
+
+ /**
+ * Returns an URL for an image or file
+ * @param string $appName the name of the app
+ * @param string $file the name of the file
+ * @return string the url
+ */
+ public function linkTo($appName, $file);
+
+ /**
+ * Returns the link to an image, like linkTo but only with prepending img/
+ * @param string $appName the name of the app
+ * @param string $file the name of the file
+ * @return string the url
+ */
+ public function imagePath($appName, $file);
+
+
+ /**
+ * Makes an URL absolute
+ * @param string $url the url in the owncloud host
+ * @return string the absolute version of the url
+ */
+ public function getAbsoluteURL($url);
+}