Download the PHP package taylornetwork/make-html without Composer

On this page you can find all versions of the php package taylornetwork/make-html. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package make-html

MakeHTML

This is a class and trait for Laravel that will convert text with line breaks and links into HTML. It also adds simple HTML tag generation as well as a helper function for imploding associative arrays.

Install

Via Composer

Dependencies

TaylorNetwork\MakeHTML will install TaylorNetwork\LaravelHelpers. Laravel should auto discover that package, but if you run into problems you may need to include the provider manually.

Setup

This package is set up with auto discovery so you should be good to go out of the box. Check Manual Setup below if something isn't working.

Manual Setup

If auto discovery doesn't work...

Add the service provider to the providers array in config/app.php.

Publishing

Run

This will add makehtml.php to your config directory.

Usage

You can use this package either by including the trait in a class you want to implement the functionality or by creating a new instance of the class.

Trait

Import the trait into your class.

The MakeHTML trait includes two functions, usage examples below.

makeHTML (string $text)

Accepts one parameter, the text you want the generator to parse.

Given this example variable $text

Calling makeHTML

Returns

getHTMLGeneratorInstance ()

Accepts no parameters and returns an instance of HTMLGenerator class, or creates one.

You can chain any methods from the HTMLGenerator class onto that to return functionality.

See class usage below for examples.

Class

Instantiate the class.

Available Methods

makeLinks (string $text)

Converts any found links in the string to clickable links with <a> tag.

Will take the base URL as the caption for the link.

For example:

Call makeLinks($textWithLink)

Returns

convertLineEndings (string $text)

Converts all line endings to HTML <br> tags.

Call convertLineEndings($textWithLineBreaks)

Returns

makeHTML (string $text)

Calls convertLineEndings($text) and makeLinks($text) and returns the converted text.

generateTag (string $tag, array $attributes, boolean $closeTag = true)

Will generate an HTML tag with any attributes given.

To generate a <div> tag with no attributes

Returns


To generate a <div> tag with attributes

Call function

Returns


To generate a <div> tag with attributes and also data between the tags, add the external attribute and everything there will be added between the tags.

Call function

Returns


To generate a <div> tag and keep it open, to process more external data for example.

Returns

closeTag(string $tag)

Closes a given tag

Returns

Magic Method

You can also call generateTag($tag, $attributes) by calling the tag you want followed by Tag

To generate a <div> tag this way

Would call generateTag('div', $attributes) for you.

Config

The config file once published is in config/makehtml.php

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of make-html with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
illuminate/support Version >=5.5
taylornetwork/laravel-helpers Version ^1.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package taylornetwork/make-html contains the following files

Loading the files please wait ....