PHP Class LaravelBook\Laravel4Powerpack\HTML

Afficher le fichier Open project: laravelbook/laravel4-powerpack Class Usage Examples

Protected Properties

Свойство Type Description
$encoding string The encoding to use
$macros array Custom macros registered by the user
$url Illuminate\Routing\UrlGenerator The url generator instance

Méthodes publiques

Méthode Description
__call ( string $method, array $parameters ) : mixed Dynamically handle calls to custom macros.
__construct ( UrlGenerator $urlGenerator = null ) Build a new instance of HTML
action ( string $action, string $title = null, array $parameters = [], array $attributes = [], $absolute = true ) : string Generate a HTML link to a controller action
asset ( string $url, string $title = null, array $attributes = [], boolean $https = null ) : string Generate a HTML link to an asset
attributes ( array $attributes ) : string Build a list of HTML attributes from an array
decode ( string $value ) : string Convert HTML entities to HTML characters
dl ( array $list, array $attributes = [] ) : string Generate a definition list.
email ( string $email ) : string Obfuscate an e-mail address to prevent spam-bots from sniffing it.
entities ( string $value ) : string Convert HTML characters to HTML entities
getUrlGenerator ( )
image ( string $url, string $alt = null, array $attributes = [] ) : string Generate an HTML image element.
link ( string $url, string $title = null, array $attributes = [], $parameters = [], boolean $https = null ) : string Generate a HTML link
macro ( string $name, Callable $callback ) : void Register a new macro with the HTML class
mailto ( string $email, string $title = null, array $attributes = [] ) : string Generate an HTML mailto link.
ol ( array $list, array $attributes = [] ) : string Generate an ordered list of items.
route ( string $name, string $title = null, array $parameters = [], array $attributes = [], $absolute = true ) : string Generate a HTML link to a route
script ( string $url, array $attributes = [] ) : string Generate a link to a JS file
script_tag ( string $script, array $attributes = [] ) : string Generate a script tag with embed javascript
secure ( string $url, string $title = null, $parameters = [], array $attributes = [] ) : string Generate a HTTPS HTML link
secureAsset ( string $url, string $title = null, array $attributes = [] ) : string Generate a HTTPS HTML link to an asset
span ( string $value, array $attributes = [] ) : string Generate a HTML span
specialchars ( string $value ) : string Convert HTML special characters
style ( string $url, array $attributes = [] ) : string Generate a link to a CSS file.
to ( string $url, string $title = null, array $attributes = [], $parameters = [], boolean $https = null ) : string Generate a HTML link
ul ( array $list, array $attributes = [] ) : string Generate an un-ordered list of items.
wrapHTMLTag ( string $value, string $tag ) : string Wraps opening and closing HTML tags around the given input.

Méthodes protégées

Méthode Description
obfuscate ( string $value ) : string Obfuscate a string to prevent spam-bots from sniffing it

Private Methods

Méthode Description
listing ( string $type, array $list, array $attributes = [] ) : string Generate an ordered or un-ordered list.

Method Details

__call() public méthode

Dynamically handle calls to custom macros.
public __call ( string $method, array $parameters ) : mixed
$method string
$parameters array
Résultat mixed

__construct() public méthode

Build a new instance of HTML
public __construct ( UrlGenerator $urlGenerator = null )
$urlGenerator Illuminate\Routing\UrlGenerator

action() public méthode

An array of parameters may be specified to fill in URI segment wildcards.
public action ( string $action, string $title = null, array $parameters = [], array $attributes = [], $absolute = true ) : string
$action string
$title string
$parameters array
$attributes array
Résultat string

asset() public méthode

Generate a HTML link to an asset
public asset ( string $url, string $title = null, array $attributes = [], boolean $https = null ) : string
$url string
$title string
$attributes array
$https boolean
Résultat string

attributes() public méthode

Build a list of HTML attributes from an array
public attributes ( array $attributes ) : string
$attributes array
Résultat string

decode() public méthode

The encoding in $encoding will be used
public decode ( string $value ) : string
$value string
Résultat string

dl() public méthode

Generate a definition list.
public dl ( array $list, array $attributes = [] ) : string
$list array
$attributes array
Résultat string

email() public méthode

Obfuscate an e-mail address to prevent spam-bots from sniffing it.
public email ( string $email ) : string
$email string
Résultat string

entities() public méthode

The encoding in $encoding will be used
public entities ( string $value ) : string
$value string
Résultat string

getUrlGenerator() public méthode

public getUrlGenerator ( )

image() public méthode

Generate an HTML image element.
public image ( string $url, string $alt = null, array $attributes = [] ) : string
$url string
$alt string
$attributes array
Résultat string

macro() public méthode

Register a new macro with the HTML class
public macro ( string $name, Callable $callback ) : void
$name string Its name
$callback Callable A closure to use
Résultat void

mailto() public méthode

The E-Mail address will be obfuscated to protect it from spam bots.
public mailto ( string $email, string $title = null, array $attributes = [] ) : string
$email string
$title string
$attributes array
Résultat string

obfuscate() protected méthode

Obfuscate a string to prevent spam-bots from sniffing it
protected obfuscate ( string $value ) : string
$value string
Résultat string

ol() public méthode

Generate an ordered list of items.
public ol ( array $list, array $attributes = [] ) : string
$list array
$attributes array
Résultat string

route() public méthode

An array of parameters may be specified to fill in URI segment wildcards.
public route ( string $name, string $title = null, array $parameters = [], array $attributes = [], $absolute = true ) : string
$name string
$title string
$parameters array
$attributes array
Résultat string

script() public méthode

Generate a link to a JS file
public script ( string $url, array $attributes = [] ) : string
$url string
$attributes array
Résultat string

script_tag() public méthode

Generate a script tag with embed javascript
public script_tag ( string $script, array $attributes = [] ) : string
$script string
$attributes array
Résultat string

secure() public méthode

Generate a HTTPS HTML link
public secure ( string $url, string $title = null, $parameters = [], array $attributes = [] ) : string
$url string
$title string
$attributes array
Résultat string

secureAsset() public méthode

Generate a HTTPS HTML link to an asset
public secureAsset ( string $url, string $title = null, array $attributes = [] ) : string
$url string
$title string
$attributes array
Résultat string

span() public méthode

Generate a HTML span
public span ( string $value, array $attributes = [] ) : string
$value string
$attributes array
Résultat string

specialchars() public méthode

The encoding in $encoding will be used
public specialchars ( string $value ) : string
$value string
Résultat string

style() public méthode

If no media type is selected, "all" will be used
public style ( string $url, array $attributes = [] ) : string
$url string
$attributes array
Résultat string

to() public méthode

Generate a HTML link
public to ( string $url, string $title = null, array $attributes = [], $parameters = [], boolean $https = null ) : string
$url string
$title string
$attributes array
$https boolean
Résultat string

ul() public méthode

Generate an un-ordered list of items.
public ul ( array $list, array $attributes = [] ) : string
$list array
$attributes array
Résultat string

wrapHTMLTag() public méthode

Wraps opening and closing HTML tags around the given input.
public wrapHTMLTag ( string $value, string $tag ) : string
$value string
$tag string
Résultat string

Property Details

$encoding protected_oe property

The encoding to use
protected string $encoding
Résultat string

$macros protected_oe property

Custom macros registered by the user
protected array $macros
Résultat array

$url protected_oe property

The url generator instance
protected UrlGenerator,Illuminate\Routing $url
Résultat Illuminate\Routing\UrlGenerator