如果url是/login或/auth/reset-密码,我想通过添加auth容器类在刀片正文标记中添加css类。
所以我有
<body> //here add class所以我试过
@if(in_array( , ['login','/auth/reset-password']) )//stuck here
<body class="auth-container">
@else()
<body> //no class
@endif()我不知道如何确定url是否是/login or /auth/reset-password,因此添加类auth-container
发布于 2017-10-02 19:02:19
请求中的is方法可以检查url是否与模式匹配。您可以使用*字符作为通配符:
<body @if(Request::is('login/*') || Request::is('auth/reset-password')) class="auth-container" @endif>https://stackoverflow.com/questions/46531946
复制相似问题