method combo documentation in bbn\Mvc\Controller
Compile and echoes all the views with the given data
function(string $title = NULL, $data = NULL, int $ttl = NULL, string $path = '')
{
$data = null,
int $ttl = null,
string $path = ''
): self
{
if (empty($path)) {
$basename = X::basename($this->_file, '.php');
if (X::indexOf(['index', 'home'], $basename) > -1) {
$bits = X::split($this->_path, '/');
if ((count($bits) === 1) && ($bits[0] === '.')) {
$path = $basename;
}
elseif (end($bits) !== $basename) {
$bits[] = $basename;
$path = X::join($bits, '/');
}
}
}
if ($this->getRoute($path ?: $this->_path, 'model')) {
$model = $ttl === null
? $this->getModel($path, X::mergeArrays($this->post, $this->data))
: $this->getCachedModel($path, X::mergeArrays($this->post, $this->data), $ttl);
if ($model && is_array($model)) {
$this->addData($model);
}
else {
$model = [];
}
}
elseif ($data === true) {
$model = $this->data;
}
$this->obj->css = $this->getLess($path, false);
if ($new_title = $this->retrieveVar($title)) {
$this->setTitle($new_title);
}
elseif ($title) {
$this->setTitle($title);
}
if ($tmp = $this->retrieveVar($data)) {
$data = $tmp;
}
elseif (!\is_array($data)) {
$data = $data === true ? $model : [];
}
if ($this->mode === 'dom') {
$this->data['script'] = $this->getJs($path, $data);
}
else {
$this->addJs($path, $data, false);
}
echo $this->getView($path);
return $this;
}
Compile and echoes all the views with the given data 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