Pressbooks\Modules\Export\Epub\Epub201::createOPF PHP Method

createOPF() protected method

Create OPF File.
protected createOPF ( array $book_contents, array $metadata )
$book_contents array
$metadata array
    protected function createOPF($book_contents, $metadata)
    {
        if (empty($this->manifest)) {
            throw new \Exception('$this->manifest cannot be empty. Did you forget to call $this->createOEPBS() ?');
        }
        // Vars
        $vars = array('meta' => $metadata, 'manifest' => $this->manifest, 'stylesheet' => $this->stylesheet, 'lang' => $this->lang);
        $vars['manifest_assets'] = $this->buildManifestAssetsHtml();
        $vars['do_copyright_license'] = strip_tags($this->doCopyrightLicense($metadata));
        // Put contents
        file_put_contents($this->tmpDir . '/book.opf', $this->loadTemplate($this->dir . '/templates/epub201/opf.php', $vars));
    }