Support the ongoing development of Laravel.io →
posted 10 years ago
Views
Last updated 1 year ago.
0

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\">";
});
Last updated 1 year ago.
0

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 ;)

Last updated 1 year ago.
0

@zenry: I'm the unlucky one, my code doesn't get PHP syntax highlighting! :D

EDIT: fixed !!

Last updated 1 year ago.
0

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.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

JeffreyR jeffreyr Joined 11 Feb 2014

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.