承接 altamash80/laminas-mvc-bootstrap-menu 相关项目开发

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

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

altamash80/laminas-mvc-bootstrap-menu

最新稳定版本:v1.2.0

Composer 安装命令:

composer require altamash80/laminas-mvc-bootstrap-menu

包简介

This repository can generate nested bootstrap menu based on ul li tag. More may come later. Thanks!

README 文档

README

This repository will contain bootstrap menu integration with laminas-mvc

Pre-Requisites

You need to have bootstrap css and js files included in your layout.phtml. If not, you can still be able to see the generated html.

Introduction

This package generates a bootstrap menu based on the configuration given in your application. Which should be compatible with Laminas-Navigation. Because this package extends Laminas-Navigation therefore the configuration should match with Laminas-Navigation. This package came into existence with the help of Frank Brückner. Thanks for the help Frank Brückner. My first contribution to Laminas MVC.

Installation using Composer

composer require altamash80/laminas-mvc-bootstrap-menu

Registering the modules in your application

<?php
return [
    'modules' => [
        // ...
        'Laminas\Navigation', // <-- Add this line if not present
        'LRPHPT', // <-- Add this line in your root_path/config/modules.config.php file
        'Application',
    ],
];

Menu Container Array

<?php

// Application/config/module.config.php
return [

    // ...
    'navigation' => [
      'default' => [
        'home' => [
           'label' => 'Home',
           'route' => 'home',
           'resource' => 'home',
        ],
        'category' => [
          'label' => 'Category',
          'uri' => '#',
          'pages' => [
            'php' => [
              'label' => 'PHP',
              'uri' => 'https://www.php.net',
            ],
            'laminas' => [
              'label' => 'Laminas',
              'uri' => 'https://getlaminas.org/',
              'resource' => 'lmcuser',
            ],
            'devider' => [
               'label' => '--devider--', // most important
               'uri' => '#',
            ],
            'magento' => [
              'label' => 'Magento',
              'uri' => 'https://business.adobe.com/products/magento/magento-commerce.html',
            ],
          ],
        ]
      ]
    ],
];

Usage in MVC View

<?=$this->navigation('default')
                    ->bootstrapMenu()
                    ->setUlClass('navbar-nav')
                    // Optional setting to use with LmcRbac route guard.
                    ->setAuthorizationService($this->LmcRbacAuthorizationServiceHelper())
                    ; ?>

HcOffCanvas Menu

<?php

// Application/config/module.config.php
use LRPHPT\Navigation\Page as LrphptPage;

return [

    // ...
    'navigation' => [
      'default' => [
        'home' => [
           'label' => 'Home',
           'route' => 'home',
           'liClass' => 'collections',
           'type' => LrphptPage\MvcPage::class,
        ],
        'cryptocurrency' => [
          'label' => 'Cryptocurrency',
          'type' => LrphptPage\UriPage::class,
          'liClass' => 'cryptocurrency',
          'uri' => 'https://www.google.com/search?q=Crypto',
          'pages' => [
            'bitcoin' => [
              'label' => 'Bitcoin',
              'uri' => 'https://www.php.net',
              'type' => LrphptPage\UriPage::class,
            ],
            'ethereum' => [
              'label' => 'Ethereum',
              'uri' => 'https://getlaminas.org/',
              'type' => LrphptPage\UriPage::class,
            ],
          ],
        ],
        'devices' => [
          'label' => 'Devices',
          'type' => LrphptPage\UriPage::class,
          'liClass' => 'devices',
          'uri' => '#',
          'type' => LrphptPage\UriPage::class,
          'pages' => [
            'mobile' => [
              'label' => 'Mobile Phones',
              'uri' => '#',
              'liClass' => 'mobile',
              'type' => LrphptPage\UriPage::class,
              'pages' => [
                'mobile1' => [
                  'label' => 'Super Smart Phone',
                  'uri' => '#',
                  'type' => LrphptPage\UriPage::class,
                ],
                'mobile2' => [
                  'label' => 'Thin Magic Mobile',
                  'uri' => '#',
                  'type' => LrphptPage\UriPage::class,
                ],
                'mobile3' => [
                  'label' => 'Performance Crusher',
                  'uri' => '#',
                  'type' => LrphptPage\UriPage::class,
                ],
              ],
            ],
            'television' => [
              'label' => 'Television',
              'uri' => '#',
              'liClass' => 'television',
              'type' => LrphptPage\UriPage::class,
              'pages' => [
                'television1' => [
                  'label' => 'Flat Superscreen',
                  'uri' => '#',
                  'type' => LrphptPage\UriPage::class,
                ],
                'television2' => [
                  'label' => 'Gigantic LED',
                  'uri' => '#',
                  'type' => LrphptPage\UriPage::class,
                ],
                'television3' => [
                  'label' => '3D Experience',
                  'uri' => '#',
                  'type' => LrphptPage\UriPage::class,
                ],
              ],
            ],
            'camera' => [
              'label' => 'Cameras',
              'uri' => '#',
              'liClass' => 'camera',
              'type' => LrphptPage\UriPage::class,
              'pages' => [
                'camera1' => [
                  'label' => 'Smart Shot',
                  'uri' => '#',
                  'type' => LrphptPage\UriPage::class,
                ],
                'camera2' => [
                  'label' => 'Power Shooter',
                  'uri' => '#',
                  'type' => LrphptPage\UriPage::class,
                ],
                'camera3' => [
                  'label' => 'Easy Photo Maker',
                  'uri' => '#',
                  'type' => LrphptPage\UriPage::class,
                ],
              ],
            ],
          ],
        ],
        'magazines' => [
          'label' => 'Magazines',
          'uri' => '#',
          'liClass' => 'magazines',
          'type' => LrphptPage\UriPage::class,
          'pages' => [
            'magazines1' => [
              'label' => 'National Geographic',
              'uri' => '#',
              'type' => LrphptPage\UriPage::class,
            ],
            'magazines2' => [
              'label' => 'Scientific American',
              'uri' => '#',
              'type' => LrphptPage\UriPage::class,
            ],
            'magazines3' => [
              'label' => 'The Spectator',
              'uri' => '#',
              'type' => LrphptPage\UriPage::class,
            ],
          ],
        ],
      ]
    ],
];

Usage in MVC View

<?=$this->navigation('default')
                    ->hcOffCanvasMenu()
                    ->setUlClass('first-nav')
                    // Optional setting to use with LmcRbac route guard.
                    ->setAuthorizationService($this->LmcRbacAuthorizationServiceHelper())
                    ; ?>

hcoffcanvas

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2022-09-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固