You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
In many cases, we have Blade partials that are wrapped up in an if statement to conditionally render them. It would be nice having something like @returnif where we exit the partial right away if the criteria is met
Blade::directive('returnif', function ($expression) {
return "<?php if($expression) return; ?>";
});
Can you provide why it would be a benefit over the existing conditionals available in the framework? Your suggested implementation could cause unexpected bugs in applications with early returns.
In many cases, we have Blade partials that are wrapped up in an if statement to conditionally render them. It would be nice having something like @returnif where we exit the partial right away if the criteria is met
Usage
The text was updated successfully, but these errors were encountered: