本文整理汇总了PHP中Illuminate\Html\HtmlBuilder类的典型用法代码示例。如果您正苦于以下问题:PHP HtmlBuilder类的具体用法?PHP HtmlBuilder怎么用?PHP HtmlBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HtmlBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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;
}
开发者ID:Grapheme,项目名称:amway,代码行数:15,代码来源:HTML.php
示例2: boot
public function boot()
{
if ($this->app->resolved('router') || $this->app->bound('router')) {
$router = $this->app['router'];
$router->get('assets/img/{a?}/{b?}/{c?}/{d?}/{e?}', '\\Assets\\Http\\Controller@img');
$router->get('assets/font/{a?}/{b?}/{c?}/{d?}/{e?}', '\\Assets\\Http\\Controller@font');
$router->get('assets/fonts/{a?}/{b?}/{c?}/{d?}/{e?}', '\\Assets\\Http\\Controller@font');
$router->get('assets/css/{a?}/{b?}/{c?}/{d?}/{e?}', '\\Assets\\Http\\Controller@css');
$router->get('assets/{type}/{a?}/{b?}/{c?}/{d?}/{e?}', '\\Assets\\Http\\Controller@compile');
}
$this->commands('\\Assets\\Console\\PublishCommand', '\\Assets\\Console\\UnpublishCommand');
if (class_exists('\\Illuminate\\Html\\HtmlBuilder')) {
\Illuminate\Html\HtmlBuilder::macro('assetPath', function ($path) {
return Asset::publishedPath($path);
});
}
}
开发者ID:saverio,项目名称:laravel-assets,代码行数:17,代码来源:ServiceProvider.php
示例3: obfuscate
/**
* Obfuscate a string to prevent spam-bots from sniffing it.
*
* @param string $value
* @return string
* @static
*/
public static function obfuscate($value)
{
return \Illuminate\Html\HtmlBuilder::obfuscate($value);
}
开发者ID:jorzhikgit,项目名称:MLM-Nexus,代码行数:11,代码来源:_ide_helper.php
示例4: hasMacro
/**
* Checks if macro is registered
*
* @param string $name
* @return boolean
* @static
*/
public static function hasMacro($name)
{
return \Illuminate\Html\HtmlBuilder::hasMacro($name);
}
开发者ID:nmkr,项目名称:basic-starter,代码行数:11,代码来源:_ide_helper.php
示例5: renderAttributes
public function renderAttributes(array $options)
{
if (!empty($options)) {
return $options = $this->html->attributes($options);
} else {
return '';
}
}
开发者ID:overturelabs,项目名称:menu,代码行数:8,代码来源:MenuBuilder.php
示例6: linkAction
/**
* Generate a HTML link to a controller action.
*
* @param string $action
* @param string $title
* @param array $parameters
* @param array $attributes
* @return string
*/
public function linkAction($action, $title = null, $parameters = array(), $attributes = array())
{
if (!$this->manager->hasActionAccess('GET', $action)) {
return;
}
return parent::linkAction($action, $title, $parameters, $attributes);
}
开发者ID:leitom,项目名称:role,代码行数:16,代码来源:HtmlBuilder.php
示例7: 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>';
}
开发者ID:manhvu1212,项目名称:videoplatform,代码行数:14,代码来源:FormBuilder.php
示例8: attributeElement
/**
* @param string $key
* @param string $value
* @return string
*/
protected function attributeElement($key, $value)
{
if (is_array($value)) {
$value = implode(' ', $value);
}
return parent::attributeElement($key, $value);
}
开发者ID:procoders,项目名称:admin,代码行数:12,代码来源:HtmlBuilder.php
示例9: 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;
}
开发者ID:jamalapriadi,项目名称:sia,代码行数:21,代码来源:BootstrapBase.php
示例10: style
public function style($url, $attributes = array(), $secure = null)
{
if ($this->url->isValidUrl($url) or !$this->app->environment('sae')) {
return parent::style($url, $attributes, $secure);
} else {
$defaults = array('media' => 'all', 'type' => 'text/css', 'rel' => 'stylesheet');
$attributes = $attributes + $defaults;
$attributes['href'] = $this->patchUrl($url, $secure, 'style');
return '<link' . $this->attributes($attributes) . '>' . PHP_EOL;
}
}
开发者ID:chariothy,项目名称:laravel4-sae,代码行数:11,代码来源:SaeAsset.php
示例11: prepareColumns
/**
* Prepare data grid columns.
*
* @param bool $results
* @return array
*/
protected function prepareColumns($model)
{
$el = [];
foreach ($this->dataGridColumns as $attributes) {
$type = array_pull($attributes, 'type');
if ($type) {
if ($type === 'a') {
$elementContent = '<%= r.' . array_pull($attributes, 'content') . ' %>';
$link = $this->html->decode($this->html->link('#', $elementContent, $attributes));
$link = str_replace('href="#"', 'href="<%= r.edit_uri %>"', $link);
$el[] = $link;
} elseif ($type === 'checkbox') {
$checkBoxName = array_pull($attributes, 'name');
$value = array_pull($attributes, 'value');
$value = '<%= r.' . $value . ' %>';
$el[] = $this->html->decode($this->form->checkbox($checkBoxName, $value, null, $attributes));
}
} else {
$el[] = '<%= r.' . array_pull($attributes, 'content') . ' %>';
}
}
return $el;
}
开发者ID:sohailaammarocs,项目名称:lfc,代码行数:29,代码来源:DataGridGenerator.php
示例12: scriptBust
/**
* @param $url
* @param array $attributes
* @param null $secure
* @param bool $force
* @return string
*/
public function scriptBust($url, $attributes = array(), $secure = null, $overrideConfig = true)
{
return parent::script($this->tryBuildBustableUrl($url, $overrideConfig), $attributes, $secure);
}
开发者ID:metalmatze,项目名称:laravel-html-cachebusting,代码行数:11,代码来源:HtmlBuilderCachebusting.php
示例13: attributes
/**
* Convert HTML attributes into "property = value" pairs.
*
* @param array $attributes
*
* @return string
*/
public function attributes($attributes = array())
{
return $this->html->attributes($attributes);
}
开发者ID:kiwina,项目名称:laravel5-menu,代码行数:11,代码来源:Builder.php
示例14: listing
/**
* Create a listing HTML element.
*
* @param string $type
* @param array $list
* @param array $attributes
* @return \Illuminate\Support\HtmlString
*/
protected function listing($type, $list, $attributes = array())
{
return new HtmlString(parent::listing($type, $list, $attributes));
}
开发者ID:minors,项目名称:html,代码行数:12,代码来源:HtmlBuilder.php
示例15: linkSecureAsset
/**
* Generate a HTTPS HTML link to an asset.
*
* @param string $url
* @param string $title
* @param array $attributes
* @param bool $enablePrefix
* @return string
*/
public function linkSecureAsset($url, $title = null, $attributes = array(), $enablePrefix = true)
{
return parent::linkSecureAsset(($enablePrefix ? $this->prefix : null) . $url, $title, $attributes);
}
开发者ID:gawdl3y,项目名称:asset-prefixer,代码行数:13,代码来源:AssetBuilder.php
示例16: 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;
}
开发者ID:acmadi,项目名称:modules-1,代码行数:13,代码来源:Module.php
示例17: __construct
/**
* Create a new HTML builder instance.
*
* @param \Illuminate\Routing\UrlGenerator $url
* @return void
*/
public function __construct(UrlGenerator $url = null)
{
parent::__construct($url);
}
开发者ID:onlystar1991,项目名称:mtdb,代码行数:10,代码来源:HtmlBuilder.php
示例18: 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)];
}
开发者ID:foxted,项目名称:meta,代码行数:11,代码来源:Meta.php
示例19: rowOpen
/**
* @param Element $row
* @return string
*/
public function rowOpen(Element $row)
{
$_atts = $this->htmlBuilder->attributes($row->getAttributes());
return '<div' . $_atts . '><div class="row">';
}
开发者ID:iyoworks,项目名称:form-builder,代码行数:9,代码来源:LaravelFormRenderer.php
示例20: __call
/**
* Some shortcuts
*/
public function __call($method, $parameters)
{
// Resource verbs
if (String::endsWith($method, 'Resource')) {
$verb = String::remove($method, 'Resource');
$parameters = Arrays::prepend($parameters, $verb);
return call_user_func_array(array($this, 'resource'), $parameters);
}
return parent::__call($method, $parameters);
}
开发者ID:anahkiasen,项目名称:cerberus,代码行数:13,代码来源:HTML.php
注:本文中的Illuminate\Html\HtmlBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论