From 4aff85cd0cc8b4f68d65ee849ad96ce26a730931 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 8 Sep 2014 21:19:44 +0200 Subject: [PATCH] add template functions for html imports --- lib/private/template/functions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/private/template/functions.php b/lib/private/template/functions.php index 09db011e74..313bedf9c9 100644 --- a/lib/private/template/functions.php +++ b/lib/private/template/functions.php @@ -41,6 +41,16 @@ function style($app, $file) { OC_Util::addStyle($app, $file); } +/** + * Shortcut for HTML imports + * @param string $app the appname + * @param string $file the path relative to the app's component folder + */ +function component($app, $file) { + $url = link_to($app, 'component/' . $file); + OC_Util::addHeader('link', array('rel' => 'import', 'href' => $url)); +} + /** * make OC_Helper::linkTo available as a simple function * @param string $app app