HtmlBuilder
class HtmlBuilder (View source)
Traits
MacroableTrait |
Properties
static protected array | $macros | The registered string macros. | from MacroableTrait |
protected UrlGenerator | $url | The URL generator instance. |
Methods
static void | macro(string $name, callable $macro) Register a custom macro. | from MacroableTrait |
static boolean | hasMacro(string $name) Checks if macro is registered | from MacroableTrait |
static mixed | __callStatic(string $method, array $parameters) Dynamically handle calls to the class. | from MacroableTrait |
mixed | __call(string $method, array $parameters) Dynamically handle calls to the class. | from MacroableTrait |
void | __construct(UrlGenerator $url = null) Create a new HTML builder instance. | |
string | entities(string $value) Convert an HTML string to entities. | |
string | decode(string $value) Convert entities to HTML characters. | |
string | script(string $url, array $attributes = array(), bool $secure = null) Generate a link to a JavaScript file. | |
string | style(string $url, array $attributes = array(), bool $secure = null) Generate a link to a CSS file. | |
string | image(string $url, string $alt = null, array $attributes = array(), bool $secure = null) Generate an HTML image element. | |
string | link(string $url, string $title = null, array $attributes = array(), bool $secure = null) Generate a HTML link. | |
string | secureLink(string $url, string $title = null, array $attributes = array()) Generate a HTTPS HTML link. | |
string | linkAsset(string $url, string $title = null, array $attributes = array(), bool $secure = null) Generate a HTML link to an asset. | |
string | linkSecureAsset(string $url, string $title = null, array $attributes = array()) Generate a HTTPS HTML link to an asset. | |
string | linkRoute(string $name, string $title = null, array $parameters = array(), array $attributes = array()) Generate a HTML link to a named route. | |
string | linkAction(string $action, string $title = null, array $parameters = array(), array $attributes = array()) Generate a HTML link to a controller action. | |
string | mailto(string $email, string $title = null, array $attributes = array()) Generate a HTML link to an email address. | |
string | email(string $email) Obfuscate an e-mail address to prevent spam-bots from sniffing it. | |
string | ol(array $list, array $attributes = array()) Generate an ordered list of items. | |
string | ul(array $list, array $attributes = array()) Generate an un-ordered list of items. | |
string | listing(string $type, array $list, array $attributes = array()) Create a listing HTML element. | |
string | listingElement(mixed $key, string $type, string $value) Create the HTML for a listing element. | |
string | nestedListing(mixed $key, string $type, string $value) Create the HTML for a nested listing attribute. | |
string | attributes(array $attributes) Build an HTML attribute string from an array. | |
string | attributeElement(string $key, string $value) Build a single attribute element. | |
string | obfuscate(string $value) Obfuscate a string to prevent spam-bots from sniffing it. |
Details
static void macro(string $name, callable $macro)
Register a custom macro.
static boolean hasMacro(string $name)
Checks if macro is registered
static mixed __callStatic(string $method, array $parameters)
Dynamically handle calls to the class.
mixed __call(string $method, array $parameters)
Dynamically handle calls to the class.
void __construct(UrlGenerator $url = null)
Create a new HTML builder instance.
string entities(string $value)
Convert an HTML string to entities.
string decode(string $value)
Convert entities to HTML characters.
string script(string $url, array $attributes = array(), bool $secure = null)
Generate a link to a JavaScript file.
string style(string $url, array $attributes = array(), bool $secure = null)
Generate a link to a CSS file.
string image(string $url, string $alt = null, array $attributes = array(), bool $secure = null)
Generate an HTML image element.
string link(string $url, string $title = null, array $attributes = array(), bool $secure = null)
Generate a HTML link.
string secureLink(string $url, string $title = null, array $attributes = array())
Generate a HTTPS HTML link.
string linkAsset(string $url, string $title = null, array $attributes = array(), bool $secure = null)
Generate a HTML link to an asset.
string linkSecureAsset(string $url, string $title = null, array $attributes = array())
Generate a HTTPS HTML link to an asset.
string linkRoute(string $name, string $title = null, array $parameters = array(), array $attributes = array())
Generate a HTML link to a named route.
string linkAction(string $action, string $title = null, array $parameters = array(), array $attributes = array())
Generate a HTML link to a controller action.
string mailto(string $email, string $title = null, array $attributes = array())
Generate a HTML link to an email address.
string email(string $email)
Obfuscate an e-mail address to prevent spam-bots from sniffing it.
string ol(array $list, array $attributes = array())
Generate an ordered list of items.
string ul(array $list, array $attributes = array())
Generate an un-ordered list of items.
protected string listing(string $type, array $list, array $attributes = array())
Create a listing HTML element.
protected string listingElement(mixed $key, string $type, string $value)
Create the HTML for a listing element.
protected string nestedListing(mixed $key, string $type, string $value)
Create the HTML for a nested listing attribute.
string attributes(array $attributes)
Build an HTML attribute string from an array.
protected string attributeElement(string $key, string $value)
Build a single attribute element.
string obfuscate(string $value)
Obfuscate a string to prevent spam-bots from sniffing it.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/4.2/Illuminate/Html/HtmlBuilder.html