2017 © Pedro Peláez
 

library laravel-betterhtml

A better HtmlBuilder for Laravel 4 (including support for raw, non-escaped HTML and more tags)

image

parker/laravel-betterhtml

A better HtmlBuilder for Laravel 4 (including support for raw, non-escaped HTML and more tags)

  • Thursday, September 11, 2014
  • by parker
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

A Better HtmlBuilder for Laravel 4

An expanded, backwards compatible HtmlBuilder for Laravel 4 which features raw HTML (and nesting builder methods), methods for all HTML5 tags, convenience functions for common tasks like creating <meta name="description"> tags, and simple wrapping capabilities., (*1)

Usage

{{ Html::div(Html::linkAction('HomeController@index', 'Back to Home'), ['class' => 'home-link']) }}

{{ Html::nav(Html::ul([

    Html::linkAction('HomeController@index', 'Home'),
    Html::linkAction('AboutUsController@index', 'About Us'),
    Html::linkAction('BlogController@index', 'Blog'),
    Html::linkAction('ContactController@form', 'Contact Us'),

], ['class' => 'navigation-list'])) }}

Installation

First, add the following line to "require" in your composer.json:, (*2)

"parker/laravel-betterhtml": "~0.1"

Next, run composer update from the command line. After that, need to replace the following service provider in your app.php config file (feel free to comment it out):, (*3)

'Illuminate\Html\HtmlServiceProvider',

with this:, (*4)

'Parker\BetterHtml\Html\HtmlServiceProvider',

To be able to access Better HtmlBuilder with the HTML facade, you need to replace the following alias in your app.php config file (feel free to comment it out):, (*5)

'HTML' => 'Illuminate\Support\Facades\HTML',

with this:, (*6)

'HTML' => 'Parker\BetterHtml\Support\Facades\HTML',

Additionally, because of the way that Laravel's e() helper is defined and used (see laravel/framework PR #4783), you also need to include BetterHtml's custom e() helper in your app/start/global.php:, (*7)

/*
|--------------------------------------------------------------------------
| Load the Better HtmlBuilder helpers
|--------------------------------------------------------------------------
|
| Here we load helpers for the Better HtmlBuilder so that they can
| override ones provided by laravel in Illuminate\Support\helpers.php.
|
*/

$betterHtmlVendor = $app['path.base'] . '/vendor/parker/laravel-betterhtml';

require $betterHtmlVendor . '/src/Parker/BetterHtml/Support/helpers.php';

Contributing

Do you know a way that we can make Laravel's HtmlBuilder even better? Please submit your ideas in the form of an issue on this repository with your proposal and a sample use case. Bug pull requests are greatly appreciated (but reports are fine too if you can't track down the cause yourself)., (*8)

Requirements

  • PHP >= 5.4.0
  • Laravel 4.2

License

BetterHtmlBuilder for Laravel 4 is open-sourced software licensed under the MIT License., (*9)

The Versions

11/09 2014

0.1.0.x-dev

0.1.0.9999999-dev https://github.com/baileyparker/laravel-betterhtml

A better HtmlBuilder for Laravel 4 (including support for raw, non-escaped HTML and more tags)

  Sources   Download

MIT

The Requires

 

by Bailey Parker

11/09 2014

dev-master

9999999-dev https://github.com/baileyparker/laravel-betterhtml

A better HtmlBuilder for Laravel 4 (including support for raw, non-escaped HTML and more tags)

  Sources   Download

MIT

The Requires

 

by Bailey Parker