/** * Render the A-Frame scene and return the HTML * * @api * * @param bool $only_scene * @return string */ public function save($only_scene = false, string $file = null) : string { $this->prepare(); $html = !$only_scene ? $this->aframeDomObj->render() : $this->aframeDomObj->renderSceneOnly(); if (!empty($file) && is_writable(dirname($file))) { file_put_contents($file, $html); } return $html; }