It won't magically happen unless you do something like this:
Form::macro('date', function($clear, $name, $id, $value) {
return "<input type=\"date\" data-clear-btn=\"$clear\" name=\"$name\" id=\"$id\" value=\"$value\">";
});
how does PHP know that your first parameter is data-clear-btn?
Form::macro('date', function($clearbtn = true, $name = '', $id = '') {
return ' <input type="date" data-clear-btn="'.$clearbtn.'" name="'.$name.'" id="'.$id.' value="">';
});
EDIT what popolla said ;)
@zenry: I'm the unlucky one, my code doesn't get PHP syntax highlighting! :D
EDIT: fixed !!
Well the string could be dissected to detect html properties or is this too far fetched?
BTW my PHP is very bad. :P
Would be a nice capability if laravel could do that though XD I'm going to look in to that!
Thanx for the help guys.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community