idci/nav-bar-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

idci/nav-bar-bundle

Composer 安装命令:

composer require idci/nav-bar-bundle

包简介

Symfony NavBarBundle

README 文档

README

Symfony2 bundle to manage a nav bar

Installation

To install this bundle please follow the next steps:

First add the dependency in your composer.json file:

"require": {
    ...
    "idci/nav-bar-bundle": "dev-master"
},

Then install the bundle with the command:

$ php composer update

Enable the bundles in your application kernel:

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new IDCI\Bundle\NavBarBundle\IDCINavBarBundle()
    );
}

Update your routing.yml file:

idci_nav_bar:
    resource: "@IDCINavBarBundle/Controller/"
    type:     annotation

Configuration

This bundle provide a simple navbar easily customizable. To configure it simply change or add items in the app/config/config.yml:

# Tms navbar configuration
idci_nav_bar:
    brand_title: "MyNAV"
    brand_url: http://www.mywebsite.com
    items:
        link1:
            title: LinkTitle1
            url: http://www.website1.com
            color: "#F00"
        link2:
            title: LinkTitle2
            url: http://www.website2.com
            color: "#00F"
        linkN:
            title: LinkTitleN
            url: http://www.websiteN.com
            color: "#000"
            target: _blank

Routes

To see the routes, run this given command:

$ php app/console router:debug --env=prod

You will get this output:

[router] Current routes
Name                   Method Scheme Host Path
idci_navbar_menu_nav ANY    ANY    ANY  /nav.{_format}

The configurated menu is now available via the HTTP protocol in diffrent formats. To see it in action simply open a web browser at the previous configurated virtual host (navbar.ens-lyon.fr) and add the following path: /nav.{_format}

ex: http://www.mywebsite.com/nav.html

Here is a list of available formats:

* html => This will display the menu
* css  => This is the generated css
* json => This is the menu data in Json format
* js   => This is the generated js to inject the menu in web page

How to use

Diffrent way to use this application exist, here is some methods but some others are posible according to your imagination.

Javascript:

Simply add a javascript source to automatically inject html and css data in order to display this menu in an existing website.

<!DOCTYPE html>
<html>
    <head>
        ...
        <script type="text/javascript" src="http://www.mywebsite.com/nav.js"></script>
    </head>
    <body>
        ...
    </body>
</html>

统计信息

  • 总下载量: 4.66k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 9
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-11-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固