API / Minn\Front / AssetsController

AssetsController final readonly class

Minn\Front\AssetsController · public/minn/src/Minn/Front/AssetsController.php · 70 lines

The engine's own static assets, served under a reserved path.

Used by 1

Constants and properties

privateTYPES = array ( 'css' => 'text/css; charset=utf-8', 'js' => 'text/javascript; charset=utf-8', 'svg' => 'image/svg+xml', )

Media types as the web server sends the reference's static files (scripts as text/javascript, with the charset).

privatePLAYER_FILES = array ( 'mediaelement-and-player.min.js' => 'vendor/mediaelement/mediaelement-and-player.min.js', 'mediaelementplayer-legacy.min.css' => 'vendor/mediaelement/mediaelementplayer-legacy.min.css', 'mejs-controls.svg' => 'vendor/mediaelement/mejs-controls.svg', 'renderers/vimeo.min.js' => 'vendor/mediaelement/renderers/vimeo.min.js', 'wp-mediaelement.min.js' => 'mediaelement/wp-mediaelement.js', 'wp-mediaelement.min.css' => 'mediaelement/wp-mediaelement.css', 'mediaelement-migrate.min.js' => 'mediaelement/mediaelement-migrate.js', )

The media player's files, by the names the reference registers them under: MediaElement.js's own (MIT, in vendor/mediaelement) and the engine's start-up, skin and migration script in their place.

privateEMBED_SCRIPTS = array ( 'wp-embed.min.js' => 'embed-host.js', 'wp-embed-template.min.js' => 'embed-card.js', )

The embed scripts, by the reference addresses a page and a card's sourceURL name them at.

privatereadonly string $assetsDir

Promoted from the constructor.

Public

new__construct(string $assetsDir)#
methodasset(Minn\Http\Request $request, string $path): Minn\Http\ResponseGET /minn/assets/{path*} (public)#

One engine asset file.

methodembedScript(Minn\Http\Request $request, string $file): Minn\Http\ResponseGET /wp-includes/js/{file:wp-embed(?:-template)?\.min\.js} (public)#

The engine's embed scripts at the addresses the reference serves its own from.

methodplayer(Minn\Http\Request $request, string $file): Minn\Http\ResponseGET /wp-includes/js/mediaelement/{file:(?:renderers/)?[a-z0-9.-]+\.(?:js|css|svg)} (public)#

The media player, at the paths the reference registers it under (wp_default_scripts, wp_default_styles).

methodjquery(Minn\Http\Request $request, string $file): Minn\Http\ResponseGET /wp-includes/js/jquery/{file:[a-z0-9.-]+\.js} (public)#

The MIT libraries the engine ships, served at the paths the reference registers them under.