Nextcloud PHP API (stable18)

Template extends OC_Template

This class provides the template system for owncloud. You can use it to load specific templates, add data and generate the html code

Tags
since
8.0.0

Table of Contents

html_select_options()  : string
Generate html code for an options block.
human_file_size()  : string
Make OC_Helper::humanFileSize available as a simple function Example: 2048 to 2 kB.
image_path()  : string
Make OC_Helper::imagePath available as a simple function
mimetype_icon()  : string
Make OC_Helper::mimetypeIcon available as a simple function
preview_icon()  : string
Make preview_icon available as a simple function
publicPreview_icon()  : string
Make publicpreview_icon available as a simple function Returns the path to the preview of the image.
relative_modified_date()  : string
Return the relative date in relation to today. Returns something like "last hour" or "two month ago"

Methods

html_select_options()

Generate html code for an options block.

public static html_select_options(array $options, mixed $selected[, array $params = array() ]) : string
Parameters
$options : array

the options

$selected : mixed

which one is selected?

$params : array = array()

the parameters

Tags
since
8.0.0
suppress

PhanDeprecatedFunction

Return values
string

html options

human_file_size()

Make OC_Helper::humanFileSize available as a simple function Example: 2048 to 2 kB.

public static human_file_size(int $bytes) : string
Parameters
$bytes : int

in bytes

Tags
since
8.0.0
suppress

PhanDeprecatedFunction

Return values
string

size as string

image_path()

Make OC_Helper::imagePath available as a simple function

public static image_path(string $app, string $image) : string
Parameters
$app : string
$image : string
Tags
see
IURLGenerator::imagePath
since
8.0.0
suppress

PhanDeprecatedFunction

Return values
string

to the image

mimetype_icon()

Make OC_Helper::mimetypeIcon available as a simple function

public static mimetype_icon(string $mimetype) : string
Parameters
$mimetype : string
Tags
since
8.0.0
suppress

PhanDeprecatedFunction

Return values
string

to the image of this file type.

preview_icon()

Make preview_icon available as a simple function

public static preview_icon(string $path) : string
Parameters
$path : string

path to file

Tags
since
8.0.0
suppress

PhanDeprecatedFunction

Return values
string

to the preview of the image

publicPreview_icon()

Make publicpreview_icon available as a simple function Returns the path to the preview of the image.

public static publicPreview_icon(string $path, string $token) : string
Parameters
$path : string

of file

$token : string
Tags
since
8.0.0
suppress

PhanDeprecatedFunction

Return values
string

link to the preview

relative_modified_date()

Return the relative date in relation to today. Returns something like "last hour" or "two month ago"

public static relative_modified_date(int $timestamp[, bool $dateOnly = false ]) : string
Parameters
$timestamp : int

unix timestamp

$dateOnly : bool = false
Tags
since
8.0.0
suppress

PhanDeprecatedFunction

suppress

PhanTypeMismatchArgument

Return values
string

human readable interpretation of the timestamp

Search results