# How to get variables from twig-template in my Subscriber class?

**URL:** <https://forum.shopware.com/t/how-to-get-variables-from-twig-template-in-my-subscriber-class/91258>\
**Category:** Shopware 6 (English)\
**Created:** [3. November 2021 um 08:01 UTC](https://forum.shopware.com/t/how-to-get-variables-from-twig-template-in-my-subscriber-class/91258 "2021-11-03T08:01:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yurii.k](https://avatars.discourse-cdn.com/v4/letter/y/90ced4/32.png) [@yurii.k](https://forum.shopware.com/u/yurii.k)\
**Post date:** [3. November 2021 um 08:01 UTC](https://forum.shopware.com/t/how-to-get-variables-from-twig-template-in-my-subscriber-class/91258/1 "2021-11-03T08:01:17Z")

</div>

Hi!  
I can set variable for twig-template in my Subscriber class via $event-\>getPage()-\>assign([……]) and it works.  
But, how I can get variables from twig-template in my Subscriber class? In Shopware 5 it was getAssign(‘myVar’), but in Shopware 6 I didn’t see it.  
Thanks a lot!
