Template¶
-
class
OCP\
Template
¶ - This class provides the template system for owncloud. You can use it to loadspecific templates, add data and generate the html code
Source: lib/public/Template.php#36 Parent: OC_Template
Methods¶
-
public static
OCP\Template::
image_path
($app, $image)¶ - Make OC_Helper::imagePath available as a simple function
Source: Parameters: - $app (string)
- $image (string)
See: Returns: string to the image
Since: 8.0.0
-
public static
OCP\Template::
mimetype_icon
($mimetype)¶ - Make OC_Helper::mimetypeIcon available as a simple function
Source: Parameters: - $mimetype (string)
Returns: string to the image of this file type.
Since: 8.0.0
-
public static
OCP\Template::
preview_icon
($path)¶ - Make preview_icon available as a simple function
Source: Parameters: - $path (string) path to file
Returns: string to the preview of the image
Since: 8.0.0
-
public static
OCP\Template::
publicPreview_icon
($path, $token)¶ - Make publicpreview_icon available as a simple functionReturns the path to the preview of the image.
Source: Parameters: - $path (string) of file
- $token (string)
Returns: string link to the preview
Since: 8.0.0
-
public static
OCP\Template::
human_file_size
($bytes)¶ - Make OC_Helper::humanFileSize available as a simple functionExample: 2048 to 2 kB.
Source: Parameters: - $bytes (int) in bytes
Returns: string size as string
Since: 8.0.0
-
public static
OCP\Template::
relative_modified_date
($timestamp, $dateOnly=false)¶ - Return the relative date in relation to today. Returns something like “last hour” or “two month ago”
Source: Parameters: - $timestamp (int) unix timestamp
- $dateOnly (bool)
Returns: string human readable interpretation of the timestamp
Since: 8.0.0
-
public static
OCP\Template::
html_select_options
($options, $selected, $params=[])¶ - Generate html code for an options block.
Source: Parameters: - $options (array) the options
- $selected (mixed) which one is selected?
- $params (array) the parameters
Returns: string html options
Since: 8.0.0