$query = $this->db->exec('SELECT * FROM '.$tablename.''); $result = $this->fetchAll($query); return $result;
$this->f3->set('navigation', \View::instance()->render('default/navigation.php','text/html'));
$this->f3->set('navigationLinks', (new MainModel)->getNavigationLinks());
array(7) { ["id"]=> string(1) "1" ["name"]=> string(12) "BeispielLink" ["url"]=> string(9) "google.de" ["hasIcon"]=> NULL ["icon"]=> NULL ["isSubGroup"]=> NULL ["subGroup"]=> NULL }
<?php foreach($navigationLinks as $links): ?><?php echo $links; ?><?php endforeach; ?>
Invalid argument supplied for foreach()
[lib/base.php:2151] Base->error()
[template/default/navigation.php:5] Base->{closure}()
[lib/base.php:2656] require('template\default\navigation.php')
[lib/base.php:2683] View->sandbox()
[classes/Main.php:21] View->render()
[classes/Presentator.php:7] Main->loadModulesForPage()
[index.php:44] Presentator->__construct()
$query = $this->db->exec('SELECT * FROM '.$tablename.'');$result = $this->fetchAll($query);return $result;
After that, i tried var_dumping it and i retrieve the following:
array(7) { ["id"]=> string(1) "1" ["name"]=> string(12) "BeispielLink" ["url"]=> string(9) "google.de" ["hasIcon"]=> NULL ["icon"]=> NULL ["isSubGroup"]=> NULL ["subGroup"]=> NULL }
So, the array is getting send to the template and has my desired content in it.
$query = $this->db->exec('SELECT * FROM '.$tablename.'');$result = $this->fetchAll($query);return $result;
After that, i tried var_dumping it and i retrieve the following:
array(7) { ["id"]=> string(1) "1" ["name"]=> string(12) "BeispielLink" ["url"]=> string(9) "google.de" ["hasIcon"]=> NULL ["icon"]=> NULL ["isSubGroup"]=> NULL ["subGroup"]=> NULL }
So, the array is getting send to the template and has my desired content in it.