API / Minn\Front / AssetsController

AssetsController final readonly class

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

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

Used by 1

Constants and properties

privateTYPES = array ( 'css' => 'text/css', 'js' => 'application/javascript', )
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.

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.