Support the ongoing development of Laravel.io →
Views Blade Forms
Last updated 2 years ago.
0

what editor are you using?

eg with PHPStorm you can write Templates for recurring code (blocks) or maybe you can install the Emmet package in your editor

0

I think there are many ways to do this.

Like @frezno said, the easiest way is to use PHPStorm Live Template, or Sublime Text Snippet.

Laravel side, if HTML class still has the macro() function, you could also do similar thing like that as well. (Haven't got time to grab a copy of L5 yet...)

Well, you don't always have to rely on Laravel, overall it could be done on client side.

  • If you are using Angular by any chance, I think you could also write your custom directives that adds these classes.
  • If you are using jQuery, you could add something similar like,
   $("input[type=submit]").addClass("btn").addClass("btn-primary");
Last updated 9 years ago.
0

Laravel: Form::submit('save',array('class'=>'btn btn-primary'));

You could also just use HTML syntax and benefit from autocomplete for style classes. (I had the same problem and for now decided to not use Illuminate\Html) Imho just html is easier to understand and live templates make it just as fast.

Maybe I missed the pros of Illuminate\Html? If so what makes this package so great?

0

Need to use this now:

"laravelcollective/html": "~5.0",

But for an editor siotuation it depends on what editor that you are using.

I'm a die hard fan of BBEdit but have been trying to transition to PHPStorm. PHPStorm offers license to people who offer open source projects and decent discounts to students. Then again Sublime is "sort of free" to use ...

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.