summaryrefslogtreecommitdiffstats
path: root/lib/template.php
diff options
context:
space:
mode:
authorJakob Sack <kde@jakobsack.de>2011-08-06 11:36:56 +0200
committerJakob Sack <kde@jakobsack.de>2011-08-06 11:36:56 +0200
commit5f7c040ec031c151f0f3bc628506ce78b127ad2f (patch)
tree039407a143646ad70c8df59c6002c2be184b95c4 /lib/template.php
parent122c3a3cf8340b5737e0b954cc4fa6b2d03b68ab (diff)
downloadnextcloud-server-5f7c040ec031c151f0f3bc628506ce78b127ad2f.tar.gz
nextcloud-server-5f7c040ec031c151f0f3bc628506ce78b127ad2f.zip
Add principals, minor changes in base.php
Diffstat (limited to 'lib/template.php')
-rw-r--r--lib/template.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/template.php b/lib/template.php
index fe173f609b2..045ecdaf130 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -321,6 +321,28 @@ class OC_Template{
}
/**
+ * @brief Include template
+ * @returns returns content of included template
+ *
+ * Includes another template. use <?php echo $this->inc('template'); ?> to
+ * do this.
+ */
+ public function inc( $file )
+ {
+ // $_ erstellen
+ $_ = $this->vars;
+
+ // Einbinden
+ ob_start();
+ include( $this->path.'/'.$file.'.php' );
+ $data = ob_get_contents();
+ ob_end_clean();
+
+ // Daten zurückgeben
+ return $data;
+ }
+
+ /**
* @brief Shortcut to print a simple page for users
* @param $application The application we render the template for
* @param $name Name of the template