# Variable issues

**URL:** https://discourse.laminas.dev/t/variable-issues/1487
**Category:** Components & MVC
**Tags:** laminas-view
**Created:** [March 30, 2020, 9:13am UTC](https://discourse.laminas.dev/t/variable-issues/1487 "2020-03-30T09:13:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![josiahking](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@josiahking](https://discourse.laminas.dev/u/josiahking)
#### Post date: [March 30, 2020, 9:13am UTC](https://discourse.laminas.dev/t/variable-issues/1487/1 "2020-03-30T09:13:01Z")

</div>

Hello, How can i pass variable around in laminas-mvc?  
I tried to use the normal viewmodel approach but I am not able to get the variable in my layout, but if i set the variable via layout approach, i could get it in the layout but not get it in other view files.

---

<div class="post-metadata">

### Author: ![froschdesign](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/froschdesign/32/38_2.png) [@froschdesign](https://discourse.laminas.dev/u/froschdesign)
#### Post date: [March 30, 2020, 9:29am UTC](https://discourse.laminas.dev/t/variable-issues/1487/2 "2020-03-30T09:29:34Z")

</div>

Please look at the view helper “[Layout](https://docs.laminas.dev/laminas-view/helpers/layout/)” which can be used in each view script. The helper offers the possibility to set variables for the layout script.  
The [“Placeholder” helper](https://docs.laminas.dev/laminas-view/helpers/placeholder/) is another option.

It all depends on what you have in mind.

[https://docs.laminas.dev/laminas-view/helpers/layout/](https://docs.laminas.dev/laminas-view/helpers/layout/)  
[https://docs.laminas.dev/laminas-view/helpers/placeholder/](https://docs.laminas.dev/laminas-view/helpers/placeholder/)
