\OCP\AppFrameworkIApi

A few very basic and frequently used API functions are combined in here

Summary

Methods
Constants
getUserId()
addScript()
addStyle()
add3rdPartyScript()
add3rdPartyStyle()
isAppEnabled()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

getUserId()

getUserId() : string

Gets the userid of the current user

Returns

string —

the user id of the current user

addScript()

addScript(string  $scriptName, string  $appName = null) : void

Adds a new javascript file

Parameters

string $scriptName

the name of the javascript in js/ without the suffix

string $appName

the name of the app, defaults to the current one

addStyle()

addStyle(string  $styleName, string  $appName = null) : void

Adds a new css file

Parameters

string $styleName

the name of the css file in css/without the suffix

string $appName

the name of the app, defaults to the current one

add3rdPartyScript()

add3rdPartyScript(string  $name) : void

Parameters

string $name

the name of the file without the suffix

add3rdPartyStyle()

add3rdPartyStyle(string  $name) : void

Parameters

string $name

the name of the file without the suffix

isAppEnabled()

isAppEnabled(string  $appName) : boolean

Checks if an app is enabled

Parameters

string $appName

the name of an app

Returns

boolean —

true if app is enabled