HTML标记中的三元运算符 - Laravel 5.6 Blade模板[关闭]

I have the below HTML tag where the value of "style" for nav tag should be loaded using ternary operator. I don't have any error but the desired result is not achieved

<nav class="navbar navbar-expand-md navbar-light navbar-laravel" 
style="{{ Request::path() }} == 'home' ? 'background-color: darkgrey' : '' ">

Can anyone help me where I am going wrong

查看全部
dpql57753
dpql57753
2019/01/23 13:42
  • laravel
  • php
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

3个回复