承接 t4web/navigation 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

t4web/navigation

最新稳定版本:1.0.5

Composer 安装命令:

composer require t4web/navigation

包简介

ZF2 Module which simplifies creationiewing menus

README 文档

README

ZF2 Module which simplifies creating and viewing menus

Usage

Add Navigation repo in yours require in composer.json:

"repositories": [
    {
        "type": "git",
        "url": "https://github.com/t4web/navigation.git"
    }
],
"require": {
    "t4web/navigation": "dev-master"
}

In your project, for example in modules/Application/Module.php, you can add Navigation service:

'factories' => array(
      'UserNavigation' => function (ServiceLocatorInterface $sl) {
          $factory =  new T4webNavigation\Factory();
          return $factory->createService($sl);
      },
  )

In your BootstrapListener you can add menu entries:

public function onBootstrap(EventInterface $e)
{
    $sl = $e->getApplication()->getServiceLocator();
    $navigarot = $sl->get('T4webNavigation\Menu\Navigator');
    $navigator->addEntry('Dashboard', 'home', 'fa fa-dashboard');
    $navigator->addEntry('Employees', 'employees-list', 'fa fa-users');
    $navigator->addEntry(TITLE, ROUTE, ENTRY_ICON_CLASS);
}

where TITLE - title in meny entry, ROUTE - route from module config, ENTRY_ICON_CLASS - class for <i> tag.

After this you can add in your layout menu rendering:

<?= $this->navigation('UserNavigation')
    ->menu()->setUlClass('navigation')
    ->setPartial('navigation'); ?>

will be render:

<ul class="navigation">
    <li>
        <a href="/"><i class="fa fa-dashboard"></i><span class="mm-text">Dashboard</span></a>
    </li>
    <li class="active">
        <a href="/employees"><i class="fa fa-users"></i><span class="mm-text">Employees</span></a>
    </li>
</ul>

For customizing menu you can copy partial from vendor/t4web/navigation/view/partials/navigation.phtml to your module and modify it.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-10-24