putyourlightson / craft-sprig-core
A reactive Twig component framework for Craft.
Fund package maintenance!
bencroker
Installs: 251 103
Dependents: 7
Suggesters: 0
Security: 0
Stars: 4
Watchers: 3
Forks: 7
Open Issues: 0
Type:craft-module
Requires
- php: ^8.2
- craftcms/cms: ^5.0
Requires (Dev)
- craftcms/ecs: dev-main
- craftcms/generator: ^2.1
- craftcms/phpstan: dev-main
- putyourlightson/craft-sprig: ^3.0
- vlucas/phpdotenv: ^5.4.1
- dev-develop
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.1
- 3.4.0
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.1
- 3.2.0
- 3.1.0
- 3.1.0-beta.1
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 3.0.0-beta.2
- 3.0.0-beta.1
- 2.x-dev
- 2.12.4
- 2.12.3
- 2.12.2
- 2.12.1
- 2.12.0
- 2.11.1
- 2.11.0
- 2.10.2
- 2.10.1
- 2.10.0
- 2.9.1
- 2.9.0
- 2.8.0
- 2.8.0-beta.1
- 2.7.4
- 2.7.3
- 2.7.2
- 2.7.1
- 2.7.0
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.6.0
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 2.0.0-beta.1
- 2.0.0-alpha.1
- v1.x-dev
- 1.4.1
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-12-01 21:27:46 UTC
README
Sprig Core Module for Craft CMS
This module provides the core functionality for the Sprig plugin, a reactive Twig component framework for Craft CMS. If you are developing a Craft plugin/module and would like to use Sprig in the control panel, then you can require this package to give you its functionality, without requiring that the site has the Sprig plugin installed.
First require the package in your plugin/module's composer.json
file.
{ "require": { "putyourlightson/craft-sprig-core": "^2.0" } }
Then bootstrap the module from within your plugin/module's init
method.
use craft\base\Plugin; use putyourlightson\sprig\Sprig; class MyPlugin extends Plugin { public function init() { parent::init(); Sprig::bootstrap(); } }
Then use the Sprig function and tags as normal in your control panel templates.
{{ sprig('_components/search') }}
If your plugin/module registers an asset bundle that depends on htmx being loaded, ensure that you specify the HtmxAssetBundle
class as a dependency.
use craft\web\AssetBundle; use putyourlightson\sprig\assets\HtmxAssetBundle; class MyAssetBundle extends AssetBundle { public $depends = [ HtmxAssetBundle::class, ]; }
Sprig plugin issues should be reported to https://github.com/putyourlightson/craft-sprig/issues
Sprig plugin changes are documented in https://github.com/putyourlightson/craft-sprig/blob/develop/CHANGELOG.md
Documentation
Learn more and read the documentation at putyourlightson.com/plugins/sprig ยป
To see working examples and video tutorials, visit the learning resources.
License
This package is licensed for free under the MIT License.
Requirements
This module requires Craft CMS 3.1.19 or later, or 4.0.0 or later, or 5.0.0 or later.
Installation
Install this package via composer.
composer require putyourlightson/craft-sprig-core
Created by PutYourLightsOn.