BrowserRenderTrait.php in Zircon Profile 8.0
File
vendor/jcalderonzumba/gastonjs/src/Browser/BrowserRenderTrait.php
View source
<?php
namespace Zumba\GastonJS\Browser;
trait BrowserRenderTrait {
protected function checkRenderOptions($options) {
if (count($options) === 0) {
$options["full"] = true;
$options["selector"] = null;
}
if (isset($options["full"]) && isset($options["selector"])) {
if ($options["full"]) {
$options["selector"] = null;
}
}
else {
if (!isset($options["full"]) && isset($options["selector"])) {
$options["full"] = false;
}
}
return $options;
}
public function render($path, $options = array()) {
$fixedOptions = $this
->checkRenderOptions($options);
return $this
->command('render', $path, $fixedOptions["full"], $fixedOptions["selector"]);
}
public function renderBase64($imageFormat, $options = array()) {
$fixedOptions = $this
->checkRenderOptions($options);
return $this
->command('render_base64', $imageFormat, $fixedOptions["full"], $fixedOptions["selector"]);
}
public function setPaperSize($paperSize) {
return $this
->command('set_paper_size', $paperSize);
}
}