Support the ongoing development of Laravel.io →
Views Blade
Last updated 7 months 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 7 months 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 7 months ago.
0
Last updated 7 months ago.
0

Sign in to participate in this thread!

LoadForge

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.

© 2022 Laravel.io - All rights reserved.