class FrontController extends AbstractActionController {
public function indexAction() {
$this->layout()->setting_data = $this->getSetting()-&g
Ok. As I understood from our conversation (see comments), your $setting_data
variable not depends on any controller environment but only on some database data. In that case the first link from my first comment is what you need.
public function onBootstrap($e)
{
$event = $e->getApplication()->getEventManager();
$event->attach('render', function($e) {
$serviceManager = $e->getApplication()->getServiceManager();
$setting = $serviceManager->get('Front/Model/Setting');
$setting_data = $setting->getSettingContent(1);
$e->getViewModel()->setVariable('setting_data', $setting_data);
});
}