method realToUrl documentation in bbn\Ide\Directories

Returns the file's URL from the real file's path.

function($file, $mvc = false) { foreach ( $dirs as $i => $d ){ // Dir's root path (directories) $root = $this->getRootPath($i); if ( strpos($file, $root) === 0 ){ $res = $i . '/'; $bits = explode('/', substr($file, \strlen($root))); // MVC if ( !empty($d['tabs']) ){ $tab_path = array_shift($bits); $fn = array_pop($bits); $ext = bbn\Str::fileExt($fn); $fn = bbn\Str::fileExt($fn, 1)[0]; $res .= implode('/', $bits); foreach ( $d['tabs'] as $t ){ if ( empty($t['fixed']) && ($t['path'] === $tab_path . '/') ){ $res .= '/' . $fn; if ( empty($mvc) ){ $res .= '/' . $t['url']; } break; } } } // Normal file else { $res .= implode('/', $bits); } return bbn\Str::parsePath($res); } } return false; }

Returns the file's URL from the real file's path. 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.