Nextcloud PHP API (master)

StandaloneTemplateResponse extends TemplateResponse
in package

A template response that does not emit the loadAdditionalScripts events.

This is useful for pages that are authenticated but do not yet show the full nextcloud UI. Like the 2FA page, or the grant page in the login flow.

Tags
since
16.0.0
template

S of int

template

H of array<string, mixed>

template-extends

TemplateResponse<int, array<string, mixed>>

Table of Contents

Constants

RENDER_AS_BASE  = 'base'
RENDER_AS_BLANK  = ''
RENDER_AS_ERROR  = 'error'
RENDER_AS_GUEST  = 'guest'
RENDER_AS_PUBLIC  = 'public'
RENDER_AS_USER  = 'user'

Properties

$appName  : string
app name
$params  : array<string|int, mixed>
parameters
$renderAs  : string
rendering type (admin, user, blank)
$templateName  : string
name of the template

Methods

__construct()  : mixed
constructor of TemplateResponse
getApp()  : string
getParams()  : array<string|int, mixed>
Used for accessing the set parameters
getRenderAs()  : string
Returns the set renderAs
getTemplateName()  : string
Used for accessing the name of the set template
render()  : string
Returns the rendered html
renderAs()  : TemplateResponse
Sets the template page
setParams()  : TemplateResponse
Sets template parameters

Constants

RENDER_AS_ERROR

public mixed RENDER_AS_ERROR = 'error'
Tags
since
20.0.0

RENDER_AS_GUEST

public mixed RENDER_AS_GUEST = 'guest'
Tags
since
20.0.0

RENDER_AS_PUBLIC

public mixed RENDER_AS_PUBLIC = 'public'
Tags
since
20.0.0

Properties

$renderAs

rendering type (admin, user, blank)

protected string $renderAs

Methods

__construct()

constructor of TemplateResponse

public __construct(string $appName, string $templateName[, array<string|int, mixed> $params = [] ][, string $renderAs = self::RENDER_AS_USER ][, S $status = Http::STATUS_OK ][, H $headers = [] ]) : mixed
Parameters
$appName : string

the name of the app to load the template from

$templateName : string

the name of the template

$params : array<string|int, mixed> = []

an array of parameters which should be passed to the template

$renderAs : string = self::RENDER_AS_USER

how the page should be rendered, defaults to user

$status : S = Http::STATUS_OK
$headers : H = []
Tags
since
6.0.0
  • parameters $params and $renderAs were added in 7.0.0

getApp()

public getApp() : string
Tags
since
25.0.0
Return values
string

the app id of the used template

getParams()

Used for accessing the set parameters

public getParams() : array<string|int, mixed>
Tags
since
6.0.0
Return values
array<string|int, mixed>

the params

getRenderAs()

Returns the set renderAs

public getRenderAs() : string
Tags
since
6.0.0
Return values
string

the renderAs value

getTemplateName()

Used for accessing the name of the set template

public getTemplateName() : string
Tags
since
6.0.0
Return values
string

the name of the used template

render()

Returns the rendered html

public render() : string
Tags
since
6.0.0
Return values
string

the rendered html

renderAs()

Sets the template page

public renderAs(string $renderAs) : TemplateResponse
Parameters
$renderAs : string

admin, user or blank. Admin also prints the admin settings header and footer, user renders the normal normal page including footer and header and blank just renders the plain template

Tags
since
6.0.0
  • return value was added in 7.0.0
Return values
TemplateResponse

Reference to this object

setParams()

Sets template parameters

public setParams(array<string|int, mixed> $params) : TemplateResponse
Parameters
$params : array<string|int, mixed>

an array with key => value structure which sets template variables

Tags
since
6.0.0
  • return value was added in 7.0.0
Return values
TemplateResponse

Reference to this object


        
On this page

Search results