PHPePub\Core\EPub::addEPub3TOC PHP Method

addEPub3TOC() public method

public addEPub3TOC ( string $fileName, string $tocData ) : boolean
$fileName string
$tocData string
return boolean
    function addEPub3TOC($fileName, $tocData)
    {
        if ($this->isEPubVersion2() || $this->isFinalized || array_key_exists($fileName, $this->fileList)) {
            return false;
        }
        if (!$this->isInitialized) {
            $this->initialize();
        }
        $fileName = RelativePath::getRelativePath($fileName);
        $fileName = preg_replace('#^[/\\.]+#i', "", $fileName);
        $this->zip->addFile($tocData, $this->bookRoot . $fileName);
        $this->fileList[$fileName] = $fileName;
        $this->opf->addItem("toc", $fileName, "application/xhtml+xml", "nav");
        return true;
    }