Airship\Cabin\Hull\Blueprint\CustomPages::getParentDir PHP Method

getParentDir() public method

Get the parent directory
public getParentDir ( array $dirs = [], string $cabin = '' ) : integer
$dirs array
$cabin string
return integer
    public function getParentDir(array $dirs = [], string $cabin = '') : int
    {
        $parent = 0;
        foreach ($dirs as $dir) {
            $parent = $this->getDirectoryId($dir, $parent, $cabin);
        }
        return $parent;
    }

Usage Example

Example #1
0
 /**
  * Public API entry point for serving a custom page
  *
  * @param string $file
  * @param array $dirs
  * @return bool
  */
 protected function serveCustomPage(string $file, array $dirs = []) : bool
 {
     return $this->serveFile($file, $this->pages->getParentDir($dirs));
 }