foreach ($elements as $section => $element) {
foreach ($element as $block) {
// here should be a check if a certain library is already loaded
// ..
$this->load->library($block['module'].'/'.$block['module']); // this loads the html or flexslider library from the module with the same name
$html = $this->$block['module']->$block['view']($block['settings']); // this call the method test from the html or the method content from the library flexslider which will create the output for the views.
if (!isset($sections[$section])) $sections[$section] = '';
$sections[$section] .= $html;
}
}