# How to assign/access variables that are not defined in a controller

**URL:** <https://forum.shopware.com/t/how-to-assign-access-variables-that-are-not-defined-in-a-controller/57592>\
**Category:** International (English Only)\
**Tags:** programming\
**Created:** [21. Januar 2019 um 11:50 UTC](https://forum.shopware.com/t/how-to-assign-access-variables-that-are-not-defined-in-a-controller/57592 "2019-01-21T11:50:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RowanMD](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@RowanMD](https://forum.shopware.com/u/RowanMD)\
**Post date:** [21. Januar 2019 um 11:50 UTC](https://forum.shopware.com/t/how-to-assign-access-variables-that-are-not-defined-in-a-controller/57592/1 "2019-01-21T11:50:29Z")

</div>

Hi,

I am trying to access the sBlogArticles variable in the Frontend/Detail-controller, but (obviously) that variable isn’t defined/assigned in the Controller.  
The variable is however assigned in the Frontend/Blog controller.&nbsp;

What is the best way to access this information in the Frontend/Detail-controller?&nbsp;  
I tried subscribing to the ‚Enlight\_Controller\_Action\_PreDispatch\_Frontend\_Detail‘ event, but I could not see how I could gain access to the current View in this Event.

Maybe there is a&nbsp; different/better solution to this problem?

Rowan

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [21. Januar 2019 um 12:11 UTC](https://forum.shopware.com/t/how-to-assign-access-variables-that-are-not-defined-in-a-controller/57592/2 "2019-01-21T12:11:21Z")

</div>

Please have a look at the plugin startup guide:&nbsp;[Plugin quick Startup Guide](https://developers.shopware.com/developers-guide/plugin-quick-start/)

The example is basically the same: prodivding addional information for a certain controller.

You only need to apply this on your case.
