You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a components view namespace by adding this to AppServiceProvider.php:
public function boot(): void
{
view()->addNamespace('components', resource_path('droplets/components'));
}
This works fine to call views like view('components::forms/input); to load /resources/droplets/components/forms/input.twig but when including other twig templates from input.twig, I need to use an absolute path to point to anything inside /resources/droplets/components.
Using something like {% include 'label' with {label: label} %} will try to load /resources/views/label.twig as twig is not aware the parent template is in the components namespace.
Hi,
I'm using a
components
view namespace by adding this toAppServiceProvider.php
:This works fine to call views like
view('components::forms/input);
to load/resources/droplets/components/forms/input.twig
but when including other twig templates frominput.twig
, I need to use an absolute path to point to anything inside/resources/droplets/components
.Using something like
{% include 'label' with {label: label} %}
will try to load/resources/views/label.twig
as twig is not aware the parent template is in the components namespace.I reckon a way to solve that would be to declare twig path namespaces like you can do in Symphony:
https://symfony.com/doc/current/templates.html#template-namespaces
What is the equivalent to that with TwigBridge, if any?
Thanks!
The text was updated successfully, but these errors were encountered: