0
votes

I have some configuration values set in application.ini and i want to pass those values to the layout on application load. How can i do this from bootstrap ? For trial i tried doing this

In my Bootstrap initialization function:

$this->bootstrap('view');
$view = $this->getResource('view');
$view->layout()->whatever = "Some Value";

In layout:

<?php echo $this->layout()->whatever; ?>

But m not able to get the value to display in the layout.

2

2 Answers

2
votes

The following should work:

$this->bootstrap('view');
$view = $this->getResource('view');
$view->whatever = 'Some value';

Then, in layout:

<?php echo $this->whatever ?>
0
votes

You have to grab the Layout and from there the view object:

$this->bootstrap('layout');
$layout = $this->getResource('layout');
$view = $layout->getView();
$view->text = 'Welcome';