method getModel documentation in bbn\Mvc\Controller
This will get the model. There is no order for the arguments.
function()
{
$args = \func_get_args();
$die = false;
foreach ($args as $a) {
if (\is_string($a)) {
$path = $a;
}
elseif (\is_array($a)) {
$data = $a;
}
elseif (\is_bool($a)) {
$die = $a;
}
}
if (empty($path)) {
$path = $this->_path;
if (($this->getMode() === 'dom') && (!defined('BBN_DEFAULT_MODE') || (BBN_DEFAULT_MODE !== 'dom'))) {
$path .= '/index';
}
}
elseif (strpos($path, './') === 0) {
$path = $this->getCurrentDir() . substr($path, 1);
}
if (!isset($data)) {
$data = $this->data;
}
$m = $this->_mvc->getModel($path, $data, $this);
if (\is_object($m)) {
$m = X::toArray($m);
}
if (!\is_array($m)) {
if ($die) {
throw new \Exception(X::_("$path is an invalid model"));
}
return [];
}
return $m;
}
This will get the model. There is no order for the arguments. 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.
© 2011-2025
BBN Solutions