1

Currently I have a form that looks like this:

{!! Form::open(['route' => 'lists.store', 'class' => 'form1']) !!}

I was wondering how can I add multiple classes something like the following

{!! Form::open(['route' => 'lists.store', 'class' => 'form', 'blah', 'blah2']) !!}

I am expecting the result to be:

<form class="form blah blah2" ...

but instead i just get an error.

4
  • @Abdulla hahahaha yep that did it thanks, make it an answer, I'll accept
    – technoY2K
    Commented Jul 29, 2015 at 4:04
  • What's this stuff {!!, what template engine, it's ugly. Just imagine doing this <jet:form action="{$route}lists.store" class="form, blah, blah2 ></jet:form> @o@ Commented Jul 29, 2015 at 4:11
  • @ArtisiticPhoenix its blade templating syntax used in Laravel. kind of like handlebars.js
    – technoY2K
    Commented Jul 29, 2015 at 4:13
  • Sorry, I don't like it. Commented Jul 29, 2015 at 4:14

1 Answer 1

9

Just Try this

{!! Form::open(['route' => 'lists.store', 'class' => 'form blah blah2']) !!}
2
  • What did you change, I have no knowledge of blade templates? Just curious can you explain with a sentence or 2? Commented Jul 29, 2015 at 4:28
  • 1
    Classes can be added without using a comma to separate them. So 'class' => 'form', 'blah', 'blah2' became 'class' => 'form blah blah2' Commented Jul 29, 2015 at 4:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.