當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Html\HtmlBuilder類代碼示例

本文整理匯總了PHP中Illuminate\Html\HtmlBuilder的典型用法代碼示例。如果您正苦於以下問題:PHP HtmlBuilder類的具體用法?PHP HtmlBuilder怎麽用?PHP HtmlBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了HtmlBuilder類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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">&times;</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


注:本文中的Illuminate\Html\HtmlBuilder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。