Skip to content

Twig cache file has path instead of name in laravel view cache for getTemplateName() #438

Open
@hsingh124

Description

Hi,

I have a laravel app using twigbridge. Whenever a template is rendered for the first time, its view cache file contains its directory path instead of its name in getTemplateName() method. All the sub templates rendered by that template (using include) have correct names in their view cache files. This is causing problems with laravel view composer as it is not being triggered due to the wrong template names.

For example, the cache file has:

public function getTemplateName()
{
    return "/var/www/app-name/resources/views/pages/profile/alternatives.twig";
}

instead of:

public function getTemplateName()
{
    return "pages.profile.alternatives";
}

Is this expected behaviour? Is there a way to use template names instead of path in this case?

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions