Download the PHP package stolz/laravel-html-tidy without Composer

On this page you can find all versions of the php package stolz/laravel-html-tidy. 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 laravel-html-tidy

Laravel HTML Tidy

tl;dr

Laravel-html-tidy is a Laravel middleware that parses Laravel's Response objects in order to detect and fix markup problems as well as to improve the layout and indent style of the resulting markup.

How it works

When editing HTML it's easy to make mistakes. Did you ever forget to close a <div> tag that made a mess of all your layout and then you went crazy trying to figure out what/where the problem was?. Wouldn't it be nice if there was a simple way to detect and fix these mistakes automatically and at the same time tidy up sloppy editing into nicely layed out markup? Well that is what W3C HTML Tidy utility is for!. HTML Tidy is available as an official PHP extension and this package makes using it with Laravel a breeze.

Once the middleware is enabled every time there is a problem with your HTML code you will see an error messages on your screen. Tidy will try its best to fix the problem for you. Also, if you take a look of the final HTML code sent to the browser you will get a pleasant surprise.

Note: HTML Tidy is fast but parsing output always adds a small overhead so consider using the middleware only in development environments.

Requirements

Installation

Install via composer

composer require stolz/laravel-html-tidy --dev

If you are using an old version of Laravel without the package discovery feature (or if you have disabled it), then you have to manually edit config/app.php file and add the service provider to the providers array:

'providers' => [
    ...
    'Stolz\HtmlTidy\ServiceProvider',
],

The default settings can validate both (x)HTML 4 and HTML 5 markups. If you want to customize the settings create the file config/tidy.php by running

php artisan vendor:publish --provider='Stolz\HtmlTidy\ServiceProvider'

Usage

If you want the middleware to be run only on specific routes, add the class in the $routeMiddleware property of your app/Http/Kernel.php file, with your desired short-hand key.

protected $routeMiddleware = [
    ...
    'tidy' => 'Stolz\HtmlTidy\Middleware',
];

Now you can use it in your routes.php file

Route::get('some/url', function () {...})->middleware('tidy');

Conversely if you want the middleware to be run on every HTTP request to your application, add the class in the $middleware property of your app/Http/Kernel.php file.

protected $middleware = [
    ...
    'Stolz\HtmlTidy\Middleware',
];

Laravel 4

If you are still using Laravel 4 instead of loading Stolz\HtmlTidy\ServiceProvider use Stolz\HtmlTidy\LegacyServiceProvider and then in your routes.php file use something like this

// Register filter
Route::filter('tidy', function($route, $request, $response) {
    return app('stolz.tidy')->handle($request, $response);
});

// Use as an 'after' filter
Route::get('/', ['after' => 'tidy', function() {
    return View::make('home');
}]);

License

MIT License © Stolz

Read the provided LICENSE file for details.


All versions of laravel-html-tidy with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
ext-tidy Version *
illuminate/support Version ^5|^6|^7
illuminate/http Version ^5|^6|^7
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 stolz/laravel-html-tidy contains the following files

Loading the files please wait ....