diff options
author | Jakob Sack <kde@jakobsack.de> | 2011-08-06 11:36:56 +0200 |
---|---|---|
committer | Jakob Sack <kde@jakobsack.de> | 2011-08-06 11:36:56 +0200 |
commit | 5f7c040ec031c151f0f3bc628506ce78b127ad2f (patch) | |
tree | 039407a143646ad70c8df59c6002c2be184b95c4 /lib/template.php | |
parent | 122c3a3cf8340b5737e0b954cc4fa6b2d03b68ab (diff) | |
download | nextcloud-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.php | 22 |
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 |