Stud.IP  4.2 Revision
assets.php File Reference

Variables

 $uri = ltrim($_SERVER['PATH_INFO'], '/')
 
 $response = new RESTAPI\Response()
 
if(! $type||! $id) elseif($type !=='css') elseif(!PluginAsset::exists($id)) else
 
 try
 
 $response ['Content-Length'] = $model->size
 
 $response ['Content-Disposition'] = 'inline; ' . encode_header_parameter('filename', $model->filename)
 

Variable Documentation

◆ $response [1/3]

$response = new RESTAPI\Response()

◆ $response [2/3]

$response[ 'Content-Length'] = $model->size

◆ $response [3/3]

$response[ 'Content-Disposition'] = 'inline; ' . encode_header_parameter('filename', $model->filename)

◆ $uri

$uri = ltrim($_SERVER['PATH_INFO'], '/')

Output plugin assets

This will load and output plugin assets. For now, this will be the compiled LESS files of plugins. All served assets will set the appropriate headers so that the browser will cache the assets for a certain amount of time.

Author
Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m GPL2 or any later version
Since
Stud.IP 3.4

◆ else

catch (Exception $e) if ( $response->body===false) else
Initial value:
{
static find($id)
Definition: SimpleORMap.class.php:383
$id
Definition: _sem_type.php:12

◆ try

try
Initial value:
{
$response->body = $asset->getContent()
$response
Definition: assets.php:22