PHP code example of agence-adeliom / lumberjack-assets

1. Go to this page and download the library: Download agence-adeliom/lumberjack-assets library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

agence-adeliom / lumberjack-assets example snippets


'providers' => [
    ...
    \Adeliom\Lumberjack\Assets\AssetsProvider::class
]

add_action( 'wp_enqueue_scripts', function () {
	\Adeliom\Lumberjack\Assets\Assets::enqueue( 'custom-asset', 'your-entrypoint', [
        'version' => null,
        'deps' => [],
        'in_footer' => true,
        'media' => 'all',
        'attributes' => []
    ]);
});

{{ entry_script_tags('your-entrypoint') }}
# Add custom attributes
{{ entry_script_tags('your-entrypoint', {'async': true}) }}

{{ entry_link_tags('your-entrypoint') }}
# Add custom attributes
{{ entry_link_tags('your-entrypoint', {'media': 'print'}) }}

# Check if the entrypoint exist
{{ entry_exists('your-entrypoint')}}

# Get the path of your asset
{{ asset('images/logo.svg') }}

# Merge html class
{% set className = "" %}
{{ className|mergeClass('your-class', "another-class", "...") }}

{% set class = {
    base: "your-base-class", // base class
    default: { // default value
        margin: "sm" 
    },
    margin: {
        xs: "...",
        sm: "..."
    }
}|mergeClass(margin|default("sm"), "your-custom-class")}

bash
composer configuration file
cp vendor/agence-adeliom/lumberjack-assets/config/assets.php web/app/themes/YOUR_THEME/config/assets.php