https://github.com/themeplate/htmx
Effortless HTMX implementation
https://github.com/themeplate/htmx
Last synced: 2 months ago
JSON representation
Effortless HTMX implementation
- Host: GitHub
- URL: https://github.com/themeplate/htmx
- Owner: ThemePlate
- License: gpl-3.0
- Created: 2024-02-17T07:29:06.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-08T16:19:21.000Z (over 1 year ago)
- Last Synced: 2025-04-12T07:03:09.500Z (about 1 year ago)
- Language: PHP
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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();
} );
```