Returns a HTML stylesheet link tag for the sources and attributes specified as arguments.

@param  array|string  $sources default "application"
@param  array   $attributes HTML attributes
@return string
354215
public function stylesheetLinkTag($sources = "application", $attributes = [])
    {
        // E.g. stylesheet_link_tag('app', ['media'=>'all']); => app-fa2ce4b45369a106436f229ca9e52bee.css
        $args = func_get_args();
        if (is_array(last($args))) {
            $attributes = array_pop($args);
        } else {
            $attributes = [];
        }
        $sources = is_array($sources) ? $sources : $args;
        if (empty($sources)) {
            $sources = ["application"];
        }

        $assetsOptions = ['host' => array_pull($attributes, 'host', $this->assetsHost)];

        $defaults = ['media' => 'all', 'type' => 'text/css'];
        $attributes = $attributes + $defaults;

        $stylesheet_tags = [];
        foreach ((array) $sources as $source) {
            $sourceName = "$source.css";
            $stylesheet_tags[] = app('html')->style($this->assetPath($sourceName, $assetsOptions), $attributes);
        }

        return implode($stylesheet_tags);
    }
486378
public static function attributes(array $attributes = array())
    {
        $text = array();
        foreach ($attributes as $key => $value) {
            //if we have numeric keys (e.g. checked), set the value as
            //the $key (e.g. checked="checked"), but only if it
            //doesn't exist already
            if (is_numeric($key)) {
                $value = htmlspecialchars($value);
                if (!isset($attributes[$value])) {
                    $text[] = $value . '="' . $value . '"';
                }
                continue;
            }
            $text[] = $key . '="' . htmlspecialchars($value) . '"';
        }

        return empty($text) ? '' : ' ' . implode(' ', $text);
    }
100568
public static function attrsToHtml(array $attributes)
    {
        $attrs = [];

        foreach ($attributes as $key => $value) {
            $element = is_numeric($key) ?
                (string)$value :
                (is_null($value) ? (string)$key : $key . '="' . e($value) . '"');
            if (!empty($element)) {
                $attrs[] = $element;
            }
        }

        return count($attrs) ? ' ' . implode(' ', $attrs) : '';
    }
81947
protected function _renderAttributes(array $attributes = [])
    {
        $attributeStrings = [];
        foreach ($attributes as $attribute => $value) {
            $attributeStrings[] = $attribute . '="' . htmlentities($value) . '"';
        }

        if (empty($attributeStrings)) {
            return '';
        }

        return ' ' . join(' ', $attributeStrings);
    }
1287816
public static function renderAttributes(array $attributes)
    {
        $html = [];
        foreach ($attributes as $key => $value) {
            $escaped = htmlentities($value, ENT_QUOTES, 'UTF-8', false);
            $html[] = is_numeric($key) ?
                ($escaped . '="' . $escaped . '""')
                :
                ("$key=\"$escaped\"");
        }
        return count($html) > 0 ? ' ' . implode(' ', $html) : '';
    }
538652
public function attributes(array $attributes)
        {
            $this->attributes = array_replace($this->attributes, $this->markup->attributes($this->tag, $attributes));

            return $this;
        }
203766
protected function _arrayToAttributesString(array $attributes) {
		$attributes_string = '';
		foreach ($attributes as $key => $value) {
			$attributes_string .= ' ' . $key . '="' . $this->_escape($value) . '"';
		}
		return $attributes_string;
	}
515505
public function getAttributesHTML($attributes = null)
    {
        // Initialise:
        
        $remove = [];
        
        // Detect Excluded Attributes:
        
        if (is_string($attributes)) {
            $remove = func_get_args();
        }
        
        // Detect Passed Attributes:
        
        if (!$attributes || is_string($attributes)) {
            $attributes = $this->getAttributes();
        }
        
        // Ensure Array Data Type:
        
        $attributes = (array) $attributes;
        
        // Remove Excluded Attributes:
        
        if (!empty($remove)) {
            $attributes = array_diff_key($attributes, array_flip($remove));
        }
        
        // Answer Markup:
        
        return ViewTools::singleton()->getAttributesHTML($attributes);
    }
802985
private function generateAttribute(string $attribute, array $values = []): string
    {
        if (! is_numeric($attribute)) {
            return sprintf(
                '%s="%s"',
                $attribute,
                htmlentities(trim(implode(' ', $values)))
            );
        }

        return implode(' ', $values);
    }
945637
public function open( $attributes = array() ) {
        $this->setAttributes( $attributes );
        $html = '<' . $this->tagName
                    . $this->renderAttributes()
                    ;
        // should we close it ?
        if( $this->closeEmpty || $this->hasChildren() ) {
            $html .= '>';
        } else {
            $html .= '/>';
        }
        return $html;
    }
370362
public function inline($source, $attributes = [], $secure = null)
    {

        return '<script type="text/javascript" ' . $this->attributes($attributes) . '>' . $source . '</script>' . PHP_EOL;
    }
774148
public function css($attributes = null)
	{
		if( ! $this->css)
			return '';

		$assets = ($this->pipeline) ? array($this->cssPipeline()) : $this->css;

		if($attributes instanceof Closure)
			return $attributes->__invoke($assets);

		// Build attributes
		$attributes = (array) $attributes;
		unset($attributes['href']);

		if( ! array_key_exists('type', $attributes))
			$attributes['type'] = 'text/css';

		if( ! array_key_exists('rel', $attributes))
			$attributes['rel'] = 'stylesheet';

		$attributes = $this->buildTagAttributes($attributes);

		// Build tags
		$output = '';
		foreach($assets as $asset)
			$output .= '<link href="' . $asset . '"' . $attributes . " />\n";

		return $output;
	}
696849
public static function link_tag($source)
    {
        $ext = strrchr($source, '.');
        if ($ext == '.css') {
            return "<link href=\"{$source}\" rel=\"stylesheet\" type=\"text/css\" />";
        } elseif ($ext == '.js') {
            return '<script type="text/javascript" src="'. $source .'"></script>';
        } elseif ($ext == '.ico') {
            return '<link href="'. $source .'" rel="shortcut icon" type="image/ico" />';
        }
    }
1163408
public function getHtml(array $attributes = []): string
    {
        $optionsHtml = '';
        foreach ($this->options as $option) {
            $optionsHtml .= $option->getHtml();
        }

        return self::buildTag('select', $optionsHtml,
            array_merge(
                [
                    'name'     => $this->getName(),
                    'required' => $this->isRequired() && $this->hasEmptyOption,
                ],
                $attributes
            ), true
        );
    }
861970
public static function attributes($attributes)
    {
        $buffer = '';

        foreach ($attributes as $name => $value) {
            $buffer .= ' ' . $name . '="' . static::attributeValue($value) . '"';
        }

        return $buffer;
    }
841632
public static function attributes(array $attributes = array())
    {
        $formattedAttributes = array();

        foreach ($attributes as $name => $value) {
            if (is_null($value)) {
                continue;
            }
            $name = is_string($name) ? $name : $value;
            $formattedAttributes[$name] = $name . '="' . self::escape($value) . '"';
        }

        return $formattedAttributes ? ' ' . implode(' ', $formattedAttributes) : '';
    }
764736
public function render($name, array $stylesheets, array $attributes = [], $newLine = true)
    {
        $formatter = $this->getFormatter();

        $tagStylesheets = [];
        foreach ($stylesheets as $stylesheet => $value) {
            $tagStylesheets[] = $this->stylesheetRenderer->render($stylesheet, $value);
        }

        return $this->getTagRenderer()->render(
            'style',
            $formatter->renderLines([
                $name.$formatter->renderSeparator().'{',
                $formatter->renderIndentation($formatter->renderLines($tagStylesheets, true, false)),
                '}',
            ], !empty($tagStylesheets), false),
            array_merge(['type' => 'test/css'], $attributes),
            $newLine
        );
    }