ThemePlate / HTMX

Effortless HTMX implementation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ThemePlate HTMX

Usage

$htmx = new ThemePlate\HTMX(/* identifier */);

add_action( 'init', array( $htmx, 'setup' ) );
add_action( 'wp_enqueue_scripts', array( $htmx->cdn(/* version */), 'assets' ) );

Identifier is used as:

  • the route namespace
  • swap templates location

*Defaults to htmx

Local script copy

add_action( 'wp_enqueue_scripts', function() use ( $htmx ) {
	wp_enqueue_script( 'htmx', '/path/to/htmx.min.js' );
	$htmx->assets();
} );

About

Effortless HTMX implementation

License:GNU General Public License v3.0


Languages

Language:PHP 100.0%