Reputation: 501
How would you do this using blade's @import method? I've tried:
@if (@include('/path/to/phpfile'))
@include('/path/to/phpfile')
@else
<h2>Oops! It doesn't look like this page exists!</h2>
@endif
also tried with file_exists()
, no dice :(
Upvotes: 1
Views: 1976
Reputation: 146201
You may try this:
@if(View::exists('viewname'))
@include('viewname')
@endif
Upvotes: 7