PHP code example of putyourlightson / craft-sprig-core

1. Go to this page and download the library: Download putyourlightson/craft-sprig-core 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/ */

    

putyourlightson / craft-sprig-core example snippets


use craft\base\Plugin;
use putyourlightson\sprig\Sprig;

class MyPlugin extends Plugin
{
    public function init()
    {
        parent::init();

        Sprig::bootstrap();
    }
}

use craft\web\AssetBundle;
use putyourlightson\sprig\assets\HtmxAssetBundle;

class MyAssetBundle extends AssetBundle
{
    public $depends = [
        HtmxAssetBundle::class,
    ];
}