get($what); } $c = new $file(); $c->setSection($section); $c->setParams($URL); if ($file != 'Action') { $v = $c->index(); $file = $v[0]; $data = $v[1]; $data['menu'] = $c->func('global', 'GetMenu'); $data['menu']['menuitems'] = is_null($data['menu'])? [] : $c->func('global', 'GetMenuitems', [$data['menu']['menu_id']]); /** * Start rendering page/ section */ foreach ($data as $var => $value) { $$var = $value; } if ($wrap) { require 'views/structure/page-top.php'; } require 'views/'.$file; if ($wrap) { require 'views/structure/page-bottom.php'; } } else { json_header(); $c->index($section); } } catch (Exception $e) { _pre($e->__toString()); } }