Render and compress assets content.

@param string|array $assets assets
@param array $options options

@return string minified content
548766
public function assets($assets, array $options = []): string
    {
        if (is_string($assets)) {
            return $this->assetEngine->assetFile($assets, $options);
        }

        return $this->assetEngine->assetFiles($assets, $options);
    }
270018
public static function render($options = null)
	{
		$pagination = new static($options);

		if (!$links = $pagination->getLinks())
		{
			return '';
		}

		if (!$pagination->view)
		{
			return $pagination->autoRender($links);
		}

		return $pagination->renderView($links);

	}
1169052
public function setHash($options)
    {
        if (!is_array($options)) {
            $options = (array) $options;
        }

        $options['algorithm'] = 'md5';
        parent::setHash($options);
        return $this;
    }
69234
public static function process($assets)
    {
        if ($directory = self::getOutputDirectory()) {
            $relativeDirectory = self::getRelativeOutputDirectory();
            $filename = '';
            $sourceFiles = array();
            for ($i = 0; $i < count($assets); ++$i) {
                $asset = $assets[$i];
                $filename .= $asset->getAssetHashKey();
                $sourceFiles[] = $asset->getAssetURL();
            }
            $filename = sha1($filename);
            $cacheFile = $directory.'/'.$filename.'.js';
            if (!file_exists($cacheFile)) {
                $js = '';
                foreach ($assets as $asset) {
                    $contents = $asset->getAssetContents();
                    if (isset($contents)) {
                        if ($asset->assetSupportsMinification()) {
                            $contents = \JShrink\Minifier::minify($contents);
                        }
                        $js .= $contents.";\n\n";
                    }
                }
                @file_put_contents($cacheFile, $js);
            }

            $asset = new self();
            $asset->setAssetURL($relativeDirectory.'/'.$filename.'.js');
            $asset->setAssetPath($directory.'/'.$filename.'.js');
            $asset->setCombinedAssetSourceFiles($sourceFiles);

            return array($asset);
        }

        return $assets;
    }
1181583
private function render(string $view, array $options = []): string
    {
        extract($options, EXTR_OVERWRITE);

        ob_start();
        require $this->getFilename($view);

        return ob_get_clean();
    }
2236
public static function get($options = array())
    {
        if (!isset(self::$_instances[md5(serialize($options))])) {
            return new HTML($options);
        }

        return self::$_instances[md5(serialize($options))];
    }
513739
public function def(array $options=[]) {
		if(!$this->widget)
			throw new \Exception('No default render function for this field');
		return $this->render($this->widget, $options);
	}
789179
public function render($options = array())
    {
        $template = $options['template'];
        $data = $options['data'];

        if (file_exists(($file = $this->templatePath.DIRECTORY_SEPARATOR.$template.'.tpl.php'))) {
            $template = file_get_contents($file);
        }
        else {
            Console::writeInfo('template '.$file.' was not found...');
        }

        return $this->renderTpl($template, $data);
    }
1329070
public function render($options = array())
    {
        $string = $options['string'];
        $data = $options['data'];

        return $this->renderTpl($string, $data);
    }
1124122
public function output($options = array())
    {
        if (!isset($options["compress"])) $options["compress"] = true;

        $this->_add_page_text();

        if ($options["compress"]) {
            $this->_pdf->set_value("compress", 6);
        } else {
            $this->_pdf->set_value("compress", 0);
        }

        $this->_close();

        if (self::$IN_MEMORY) {
            $data = $this->_pdf->get_buffer();
        } else {
            $data = file_get_contents($this->_file);

            //debugpng
            if ($this->_dompdf->getOptions()->getDebugPng()) {
                print '[pdflib output unlink ' . $this->_file . ']';
            }
            if (!$this->_dompdf->getOptions()->getDebugKeepTemp()) {
                unlink($this->_file);
            }
            $this->_file = null;
            unset($this->_file);
        }

        return $data;
    }
267426
protected function renderTextareaWidget($content, array $options = [])
    {
        $options = array_replace([
            'html' => false,
        ], $options);

        return $this->renderBlock('show_widget_textarea', [
            'content' => $content,
            'options' => $options,
        ]);
    }
1054557
public function renderAssets()
    {
        // Retrieve path to Resources and shortname's class
        $class = $this->getClass();
        $path = $class['resources'].S.'assets'.S;

        // Get assets
        $script = $this->getModel()->getScript();
        $style = $this->getModel()->getStyle();

        $assets = [];

        // Do nothing if all empty
        if (empty($script) && empty($style)) {
            return $assets;
        }

        // Scripts
        if (!empty($script)) {
            $assets[$script] = $path.$script;
        }

        // Styles
        if (!empty($style)) {
            $assets[$style] = $path.$style;
        }

        return $assets;
    }
1165461
public function autoload($assets)
    {
        foreach ($assets as $position => $collections) {
            if (property_exists($this, $position)) {

                if ($collections instanceof \ArrayObject) {
                    $collections = $collections->getArrayCopy();
                }

                $this->{$position}->loadCollections($collections);
            } elseif ($position === 'packages') {
                $this->loadPackages($collections);
            } elseif ($position === 'css') {
                $this->loadCss($collections);
            } elseif ($position === 'js') {
                $this->loadJs($collections);
            }
        }
    }
1262667
public static function createFromOptions(array $options)
    {
        Validate::notNull($options['Name'], 'options[Name]');
        Validate::notNull($options['ParentAssetId'], 'options[ParentAssetId]');

        $assetFile = new self($options['Name'], $options['ParentAssetId']);
        $assetFile->fromArray($options);

        return $assetFile;
    }
784188
public function render(array $options = []): string
    {
        // Set the options to use
        $this->resolveOptions($options);

        if (false === $this->validate()) {
            return false;
        }

        // Splits the content of the cells to fit into the defined line length
        $this->splitCellsContent();

        /*
         * Calculate the height of each row and the width of each column.
         * The height is equal to highest cell content found in the row.
         * The width is equal to the longest line found in the content of each cell of the column.
         */
        $this->calculateSizes();

        $this->tableWidth = $this->calculateTableWidth();

        $table = $this->options['has_header'] ? $this->drawHeaderDivider() : $this->drawDivider();

        // If the top divider of the header hasn't to be shown...
        if ($this->options['has_header'] && false === $this->options['show_head_top_sep']) {
            // ... Remove it
            $table = '';
        }

        foreach ($this->data as $rowPosition => $rowContent) {
            $table .= $this->drawRow($rowPosition, $rowContent);
            $table .= $this->options['has_header'] && 0 === $rowPosition ? $this->drawHeaderDivider() : $this->drawDivider();
        }

        $this->table = $table;

        // Reset options
        $this->options = [];

        return $this->table;
    }
1144739
public function renderGroup($assets) {
		$out = array();
		if ($this->f3->get('ASSETS.trim_public_root')) {
			$basePath=$this->f3->fixslashes(realpath($this->f3->fixslashes(
				$_SERVER['DOCUMENT_ROOT'].$this->f3->get('BASE'))));
			$cDir=$this->f3->fixslashes(getcwd());
			$trimPublicDir=str_replace($cDir,'',$basePath);
		}
		foreach($assets as $asset_type=>$collection) {
			if ($this->f3->exists('ASSETS.filter.'.$asset_type,$filters)) {
				if (is_string($filters))
					$filters = $this->f3->split($filters);
				$flist=array_flip($filters);
				$filters = array_values(array_intersect_key(array_replace($flist, $this->filter), $flist));
				$collection = $this->f3->relay($filters,array($collection));
			}
			foreach($collection as $asset) {
				if (isset($asset['path'])) {
					$path = $asset['path'];
					$mtime = ($this->f3->get('ASSETS.timestamps') && $asset['origin']!='external'
						&& is_file($path)) ? '?'.filemtime($path) : '';
					$base = ($this->f3->get('ASSETS.prepend_base') && $asset['origin']!='external'
						&& is_file($path)) ? $this->f3->get('BASE').'/': '';
					if (isset($trimPublicDir) && $asset['origin']!='external')
						$path = substr($path,strlen($trimPublicDir));
					$asset['path'] = $base.$path.$mtime;
				}
				$out[]=$this->f3->call($this->formatter[$asset_type],array($asset));
			}
		}
		return "\n\t".implode("\n\t",$out)."\n";
	}
122939
public function render($options = array())
    {
        $options = array_merge($this->defaultOptions, $options);
        return $this->view->make('shareable::twitter', array('options' => $options));
    }