2017 © Pedro Peláez
 

library html

Html Component contains methods that can be useful when working with HTML.

image

flextype-components/html

Html Component contains methods that can be useful when working with HTML.

  • Monday, April 23, 2018
  • by Awilum
  • Repository
  • 1 Watchers
  • 0 Stars
  • 83 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 66 % Grown

The README.md

Html Component

version MIT License, (*1)

Html Component contains methods that can be useful when working with HTML., (*2)

Installation

composer require flextype-components/html

Usage

use Flextype\Component\Html\Html;

Registers a custom macro., (*3)

// Registering a Html macro
Html::macro('my_element', function() {
    return '<element id="flextype">';
});

// Calling a custom Html macro
echo Html::my_element();

// Registering a Html macro with parameters
Html::macro('my_element', function($id = '') {
    return '<element id="'.$id.'">';
});

// Calling a custom Html macro with parameters
echo Html::my_element('flextype');

Convert special characters to HTML entities. All untrusted content
should be passed through this method to prevent XSS injections., (*4)

echo Html::toText('test');

Compiles an array of HTML attributes into an attribute string.
Attributes will be sorted using Html::$attribute_order for consistency., (*5)

echo '<div'.Html::attributes($attrs).'>'.$content.'</div>';

Create br tags, (*6)

echo Html::br(2);

Create  , (*7)

echo Html::nbsp(2);

Create an arrow, (*8)

echo Html::arrow('right');

Create HTML link anchor., (*9)

echo Html::anchor('About', 'http://sitename.com/about');

Create HTML tag, (*10)

echo Html::heading('Title', 1);

Generate document type declarations, (*11)

echo Html::doctype('html5');

Create image, (*12)

echo Html::image('data/files/pic1.jpg');

Obfuscate an e-mail address to prevent spam-bots from sniffing it., (*13)

echo Html::email('hello@flextype.org');

Obfuscate a string to prevent spam-bots from sniffing it., (*14)

This method obfuscate the value, randomly convert each
letter to its entity or hexadecimal representation, keeping a
bot from sniffing the randomly obfuscated letters., (*15)

echo Html::obfuscate('hello@flextype.org');

License

See LICENSE, (*16)

The Versions

23/04 2018

dev-master

9999999-dev https://github.com/flextype-components/html

Html Component contains methods that can be useful when working with HTML.

  Sources   Download

MIT

The Requires

  • php ^7.1.3

 

html

23/04 2018

v1.0.0

1.0.0.0 https://github.com/flextype-components/html

Html Component contains methods that can be useful when working with HTML.

  Sources   Download

MIT

The Requires

  • php ^7.1.3

 

html