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

I like it, especially because if you're using a helper class, because you can use a syntax like this:

<select>
    {{ $formHelper->years(1997, 2007) }}
</select>
Last updated 1 year ago.
0

I think I'd still prefer using a macro.

HTML::macro('human_size', function($bytes)
{
    $units = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB'];
    for ($i = 0; $bytes > 1024; $i++) {
        $bytes /= 1024;
    }
    return round($bytes, 2).' '.$units[$i];
});

and then calling

{{ HTML::human_size('123456789') }}
Last updated 1 year ago.
0
Last updated 1 year ago.
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.