Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 586 Bytes

getting-started.md

File metadata and controls

28 lines (22 loc) · 586 Bytes
nav_order
1

Getting started

Getting started - the AssetManager

When using Assets in your theme or plugin, you can simply access the Inpsyde\Assets\AssetManager by hooking into the setup-hook.

This way you can start registering your assets:

<?php
use Inpsyde\Assets\AssetManager;
use Inpsyde\Assets\Script;
use Inpsyde\Assets\Style;

add_action(
	AssetManager::ACTION_SETUP,
	function(AssetManager $assetManager) {
		$assetManager->register(
			new Script('foo', 'www.example.com/script.js'),
			new Style('foo', 'www.example.com/style.css')
		);
	}
);