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
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_BASE
public
mixed
RENDER_AS_BASE
= 'base'
Tags
RENDER_AS_BLANK
public
mixed
RENDER_AS_BLANK
= ''
Tags
RENDER_AS_ERROR
public
mixed
RENDER_AS_ERROR
= 'error'
Tags
RENDER_AS_GUEST
public
mixed
RENDER_AS_GUEST
= 'guest'
Tags
RENDER_AS_PUBLIC
public
mixed
RENDER_AS_PUBLIC
= 'public'
Tags
RENDER_AS_USER
public
mixed
RENDER_AS_USER
= 'user'
Tags
Properties
$appName
app name
protected
string
$appName
$params
parameters
protected
array<string|int, mixed>
$params
$renderAs
rendering type (admin, user, blank)
protected
string
$renderAs
$templateName
name of the template
protected
string
$templateName
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
getApp()
public
getApp() : string
Tags
Return values
string —the app id of the used template
getParams()
Used for accessing the set parameters
public
getParams() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —the params
getRenderAs()
Returns the set renderAs
public
getRenderAs() : string
Tags
Return values
string —the renderAs value
getTemplateName()
Used for accessing the name of the set template
public
getTemplateName() : string
Tags
Return values
string —the name of the used template
render()
Returns the rendered html
public
render() : string
Tags
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
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
Return values
TemplateResponse —Reference to this object