Skip to content

[Question] How to get Template Name using a TwigFunction #3790

Discussion options

You must be logged in to vote

I am really struggling with it because I want to implement this feature but I am not that good with complex OOP.

What I can do from within my above function is to access the Twig\Environment Object

When I print_r this object I get the content of the entire object.
What I would like to access directly are the following things:

    [name:Twig\Source:private] => list.twig
    [path:Twig\Source:private] => D:\Xampp_PHP8.2\htdocs\WBCE_CMS\wbce\modules\droplets\templates\list.twig

and

                    [45] => Twig\Token Object
                        (
                            [value:Twig\Token:private] => debug_dump
                            [type:Twig\Token:private] => 5
            …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@stof
Comment options

Answer selected by WebDesignWorx
Comment options

You must be logged in to vote
2 replies
@stof
Comment options

@ericmorand
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #3783 on December 26, 2022 16:38.