Components live in the components/
directory, which should be directly inside your views/
directory.
views/
components/
ComponentName/
component.php
template.twig
The only required file is template.twig
, which should contain the markup for your component. You may use the component.php
file to run PHP code associated with your component. You can read more about that in Passing Data to Components