久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 Laravel 5 中設(shè)置 Bootstrap 導(dǎo)航欄活動(dòng)類

Setting Bootstrap navbar active class in Laravel 5(在 Laravel 5 中設(shè)置 Bootstrap 導(dǎo)航欄活動(dòng)類)
本文介紹了在 Laravel 5 中設(shè)置 Bootstrap 導(dǎo)航欄活動(dòng)類的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我一直在尋找解決方案,但無(wú)法真正理解,尤其是在創(chuàng)建助手時(shí).我是 Laravel 的新手,我想要一個(gè)簡(jiǎn)單的或詳細(xì)的說(shuō)明,說(shuō)明如何為我的引導(dǎo)程序?qū)Ш綑谠O(shè)置活動(dòng)類.

這是我到目前為止所做的,但無(wú)法完成:

<導(dǎo)航><ul class="nav nav-pills pull-right"><li class=""><a href="{{ url('/') }}">首頁(yè)</a><li {{ Request::is('about*') ?'類=活動(dòng)"': null }}><a href="{{ url('about') }}>關(guān)于我們</a><li><a href={{ url('auth/login') }}">登錄</a></nav><h2 class="">煙草預(yù)防和控制計(jì)劃</h2>

編輯

設(shè)置 class=active" 將使所有導(dǎo)航藥丸處于活動(dòng)狀態(tài).預(yù)期的效果是只有當(dāng)前頁(yè)面的 liactive 類.

解決方案

I've been wondering around looking for solutions, but can't really understand especially when creating helpers. I'm new in Laravel and I want a simple or if not a detailed instruction on how to set the active class for my bootstrap navbar.

Here's what I've done so far, but can't get it done:

<div class="header clearfix">
        <nav>
          <ul class="nav nav-pills pull-right">
            <li class=""><a href="{{ url('/') }}">Home</a>
            </li>
            <li {{ Request::is('about*') ? ' class="active"' : null }}><a href="{{ url('about') }}">About Us</a>
            </li>
            <li><a href="{{ url('auth/login') }}">Login</a>
            </li>
        </ul>
    </nav>
    <h2 class="">Tobacco Prevention and Control Program</h2>
</div>

EDIT

Setting class="active" will make all nav-pills active. The intended effect is that only the li of the current page have the active class.

解決方案

<ul class="nav nav-second-level">
                    <li class="{{ Request::segment(1) === 'programs' ? 'active' : null }}">
                        <a href="{{ url('programs' )}}" ></i> Programs</a>
                    </li>
                    <li class="{{ Request::segment(1) === 'beneficiaries' ? 'active' : null }}">
                        <a href="{{url('beneficiaries')}}"> Beneficiaries</a>
                    </li>
                    <li class="{{ Request::segment(1) === 'indicators' ? 'active' : null }}">
                        <a href="{{url('indicators')}}"> Indicators</a>
                    </li>                     
                </ul>

這篇關(guān)于在 Laravel 5 中設(shè)置 Bootstrap 導(dǎo)航欄活動(dòng)類的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

add new element in laravel collection object(在 Laravel 集合對(duì)象中添加新元素)
Creating an edit modal in Laravel 5(在 Laravel 5 中創(chuàng)建編輯模式)
Laravel 5.5 API resources for collections (standalone data)(用于集合的 Laravel 5.5 API 資源(獨(dú)立數(shù)據(jù)))
What is the best practice to create a custom helper function in php Laravel 5?(在 php Laravel 5 中創(chuàng)建自定義輔助函數(shù)的最佳實(shí)踐是什么?)
No #39;Access-Control-Allow-Origin#39; header - Laravel(沒(méi)有“Access-Control-Allow-Origin標(biāo)頭 - Laravel)
Laravel Passport Route redirects to login page(Laravel Passport Route 重定向到登錄頁(yè)面)
主站蜘蛛池模板: 福利视频一二区 | 欧美亚洲在线 | 暖暖成人免费视频 | 在线观看中文字幕一区二区 | 欧美电影一区 | 国产福利在线播放麻豆 | 男女午夜免费视频 | 一级黄色日本片 | 国产精品夜色一区二区三区 | 亚洲一区二区三区四区五区中文 | av毛片 | 久久久久久亚洲精品 | 国产精品精品视频一区二区三区 | 亚洲欧美中文日韩在线v日本 | 蜜桃视频在线观看免费视频网站www | 国产成在线观看免费视频 | 亚洲欧美日本在线 | 午夜视频在线观看网址 | 毛片.com | 欧美中文字幕一区二区三区亚洲 | 欧美 日韩 国产 成人 | 91夜夜夜| 国产午夜精品视频 | 中文字幕在线观看第一页 | 国产精品视屏 | 亚洲成人一区二区在线 | 欧美亚洲综合久久 | 成人久久久 | 视频一区在线 | 一区二区三区观看视频 | 欧美久久久电影 | 欧美 日韩精品 | 91精品国产综合久久久久久丝袜 | 中文字幕视频免费 | 成人三级视频 | 亚洲啪啪一区 | 日韩免费视频一区二区 | 日本三级做a全过程在线观看 | 午夜影晥 | 最新中文字幕一区 | 精品国产青草久久久久96 |