method getComponent documentation in bbn\Mvc\Controller

Returns a component with it's content from the given name if exists and null otherwise.

function(string $name, array $data = []) { if ($tmp = $this->routeComponent($name)) { if (!empty($tmp['js'])) { $v = new View($tmp['js']); $res = [ 'name' => $name, 'script' => $v->get($data) ]; if (!empty($tmp['css'])) { $v = new View($tmp['css']); $res['css'] = $v->get(); } if (!empty($tmp['html'])) { $v = new View($tmp['html']); if (!$data) { $data = []; } $data['componentName'] = $name; $res['content'] = $v->get($data); } return $res; } } return null; }

Returns a component with it's content from the given name if exists and null otherwise. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.