Extending / Bundled Extensions / Introduction
What is a Bundle¶
Bundled extensions, or "Bundles", should be thought of as components that are specific to your site project.
Simply a Bundle is:
- A PHP loader class located in the site
src/directory* that implements
Bolt\Extension\ExtensionInterfaceand adds your required functionality to the application container
- A PSR-4 autoload entry, e.g.
extensions:value in your
Every Bundle you implement for your site will have these properties.
Bundles are developed, managed, and deployed using the same tools and methodologies you would normally use to deploy your Bolt site.
Bundles have a lot in common with regular extensions, such as you'd install from the Marketplace.
Note: Bundle PHP class files can live anywhere
on your project's filesystem. However for simplicity, and ease of understanding
documented examples, it is recommended that they are placed in either the
src/ directory or a subdirectory thereof.
What a Bundle is not¶
Bundles are, by design, intended as PHP code that provides a collection of site-specific functionality.
It is very important to note that, Bundles do not:
- Manage updating of included web assets with public directories
- Require a
- Auto-configure autoloading
When & why to use a Bundle¶
Bundles are intended for:
- Functionality that is specific to a site
- Code that is intended to be committed to your project's version control
Bundles are not intended for:
- Publishing on the Bolt Marketplace
- Running extensions from the Bolt Marketplace
Difference to Marketplace Extensions¶
One big difference between Bundles and normal extensions is that Bundles
do not require their own