Download the PHP package trendyminds/molecule without Composer
On this page you can find all versions of the php package trendyminds/molecule. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download trendyminds/molecule
More information about trendyminds/molecule
Files in trendyminds/molecule
Package molecule
Short Description Grab Twig components, CSS and JS files outside the primary template folder
License MIT
Informations about the package molecule
Molecule
Why Molecule?
Molecule allows you to grab Twig components from outside the template folder. This is useful if you want to keep your Twig partials, CSS, React/Vue files, etc in a single component folder. Now all of your components are nicely organized in individual folder structures!
Example use
Setup your ButtonPrimary/index.twig
partial:
Then include in your Twig templates using the following syntax:
You can even include components in other components!
/components/Hero/index.twig
Icon Components
If you have an Icon/
component there's an additional craft.molecule.icon()
helper you can use to output the SVG directly into your templates.
will compile to:
Testimonials
Matt Rothenberg @mattrothenberg
@aaronbushnell @CraftCMS I went all in 😜.
Feels so nice to be able to "compose" components in a React-y way, too. https://twitter.com/mattrothenberg/status/1094693570177654784/photo/1
Requirements
This plugin requires Craft CMS 3.0.0-beta.23 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require trendyminds/molecule
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Molecule.
- Configure the path to your components directory within Molecule's settings
Credits
Icon by Aaron Humphreys — Dribbble post