1

I'm just starting out in Zend Framework 3 after using 1.12 for years. When I pass a variable to the view model it shows up just fine in the view script. However, I'm having trouble accessing those variables inside my layout scripts.

The following code doesn't work

<?= $this->vars('title');  ?>

Any ideas?

1 Answer 1

3

Finally found out how to do this in a controller:

$this->layout()->setVariable('title', 'SUPPORT CENTER');
Sign up to request clarification or add additional context in comments.

2 Comments

how do you echo the var in the layout?
echo $this->title;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.