本文整理汇总了PHP中Illuminate\Html\HtmlBuilder::attributes方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlBuilder::attributes方法的具体用法?PHP HtmlBuilder::attributes怎么用?PHP HtmlBuilder::attributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Html\HtmlBuilder
的用法示例。
在下文中一共展示了HtmlBuilder::attributes方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderAttributes
public function renderAttributes(array $options)
{
if (!empty($options)) {
return $options = $this->html->attributes($options);
} else {
return '';
}
}
示例2: button
/**
* Create a button element.
*
* @param string $value
* @param array $options
* @return string
*/
public function button($value = null, $options = array())
{
if (!array_key_exists('type', $options)) {
$options['type'] = 'button';
}
return '<button' . $this->html->attributes($options) . '>' . $value . '</button>';
}
示例3: scriptmod
/**
* Generate a link to a JavaScript file.
*
* @param string $url
* @param array $attributes
* @param bool $secure
* @return string
*/
public static function scriptmod($url, $attributes = array(), $secure = null)
{
$HtmlBuilder = new HtmlBuilder();
$filemtime = @filemtime(@dirname(@$_SERVER['SCRIPT_FILENAME']) . "/" . $url);
$attributes['src'] = asset($url, $secure) . ($filemtime > 0 ? "?" . $filemtime : "");
return '<script' . $HtmlBuilder->attributes($attributes) . '></script>' . PHP_EOL;
}
示例4: alert
/**
* Create an alert item with optional emphasis.
*
* @param string $type
* @param string $content
* @param string $emphasis
* @param boolean $dismissible
* @param array $attributes
*
* @return string
*/
protected function alert($type = 'message', $content = null, $emphasis = null, $dismissible = false, array $attributes = array())
{
$attributes = array_merge(array('class' => 'alert' . ($dismissible ? ' alert-dismissable' : '') . ' alert-' . ($type != 'message' ? $type : 'default')), $attributes);
$return = '<div ' . $this->html->attributes($attributes) . '>';
if ($dismissible !== null) {
$return .= '<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>';
}
$return .= ($emphasis !== null && is_string($emphasis) ? '<strong>' . $emphasis . '</strong> ' : '') . $content . '</div>';
return $return;
}
示例5: attributes
/**
* Build an HTML attribute string from an array.
*
* @param array $attributes
* @return string
* @static
*/
public static function attributes($attributes)
{
return \Illuminate\Html\HtmlBuilder::attributes($attributes);
}
示例6: script
/**
* Generate a link to a JavaScript file.
*
* @param string $name
* @param string $url
* @param array $attributes
* @return string
*/
public function script($name, $url, $attributes = array(), $secure = false)
{
$attributes['src'] = $this->asset($name, $url, $secure);
return '<script' . $this->html->attributes($attributes) . '></script>' . PHP_EOL;
}
示例7: attributes
/**
* Convert HTML attributes into "property = value" pairs.
*
* @param array $attributes
*
* @return string
*/
public function attributes($attributes = array())
{
return $this->html->attributes($attributes);
}
示例8: rowOpen
/**
* @param Element $row
* @return string
*/
public function rowOpen(Element $row)
{
$_atts = $this->htmlBuilder->attributes($row->getAttributes());
return '<div' . $_atts . '><div class="row">';
}
示例9: pairedTag
/**
* Generate a self-closing tag
* @param $tagName
* @param $tagContent
* @param array $tagAttributes
* @return array
*/
private function pairedTag($tagName, $tagContent, $tagAttributes = [])
{
return ['type' => MetaFacade::PAIRED_TAG, 'tag' => $tagName, 'content' => $tagContent, 'attributes' => $this->htmlBuilder->attributes($tagAttributes)];
}