method listTabsWithFile documentation in bbn\Appui\Ide
Function that returns the list of tab that contains a file or not for mvc and component
function(string $type, string $path, string $repository)
{
$list = [];
$root = $this->getRootPath($repository);
if ($type === 'mvc') {
if (is_string($path)) {
if (strpos($path, 'mvc/') === 0) {
$path = substr($path, 4);
}
if (strpos($path, '/mvc') === 0) {
$path = substr($path, 5);
}
}
}
$tabs = $this->tabsOfTypeProject($type);
if (is_string($path) && is_array($tabs)) {
foreach ($tabs as $tab) {
$exist = false;
if ($type === 'mvc') {
$file = $root . 'mvc/' . $tab['path'] . $path . '.';
} elseif ($type === 'components') {
$file = $root . $path . '.';
}
foreach ($tab['extensions'] as $ext) {
if ($this->fs->exists($file . $ext['ext'])) {
$exist = true;
break;
}
}
if (($exist === false) && !in_array($tab['url'], $list)) {
$list[] = $tab['url'];
}
}
return $list;
}
return false;
}
Function that returns the list of tab that contains a file or not for mvc and component 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-2023
BBN Solutions