I need something like WidgetWhen(Condition,WidgetView)
mma56k opened this issue · 4 comments
mma56k commented
I need something like WidgetWhen(Condition,WidgetView)
Yahav commented
Ohh, that's a really good idea 👍
Yahav commented
Perhaps something like this:
Blade::directive('widgetWhen', function ($conditionResult, $expression) use ($omitParenthesis) {
if ($conditionResult===true) {
$expression = $omitParenthesis ? $expression : "($expression)";
return "renderWidget{$expression}; ?>";
}
else {
return "";
}
});
mma56k commented
thanks a lot.
but i suggest something more simple
to reduce lines of code
imanghafoori1 commented
stay away from it