我尝试在laravel中的blade.php中编写代码,但是给出了错误
我正常的PHP代码是:
<?php echo $uri_segment == "users" ? "active" : "";
use App\Libraries\Commonlibrary;
$menu_list_view = Commonlibrary::sidebar_menu_list();
echo $menu_list_view;
?>
我在blade.php中做的事情如下:
{{ $uri_segment == "users" ? "active" : "" }}
@php use App\Libraries\Commonlibrary;
$menu_list_view = Commonlibrary::sidebar_menu_list();
@endphp
{{ $menu_list_view }}