Breki
118
1
Laravel

Blade Templating Woes

Posted 4 months ago by Breki

I've got a design heavily based on components which are passed variables. However, some of these variables are optional, so my blade templates have a whole lot of @if(!empty($title)) in them.

Now, before I go writing my own blade tag for this kind of thing, is there something in the language that would cover this kind of scenario in a better-looking way? I'm looking for something like an @ifexists($title) or @ifset($title) kind of a thing.

Please sign in or create an account to participate in this conversation.