An open API service indexing awesome lists of open source software.

https://github.com/themeplate/htmx

Effortless HTMX implementation
https://github.com/themeplate/htmx

Last synced: 2 months ago
JSON representation

Effortless HTMX implementation

Awesome Lists containing this project

README

          

# ThemePlate HTMX

## Usage

```php
$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

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