承接 jmf/twig-tabs-bundle 相关项目开发

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

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

jmf/twig-tabs-bundle

Composer 安装命令:

composer require jmf/twig-tabs-bundle

包简介

Symfony bundle for rendering Bootstrap tabs in Twig templates.

README 文档

README

Symfony bundle integrating jmf/twig-tabs: a Twig tabs() / tab() API that renders tabbed content in Twig templates (defaulting to Bootstrap 5 theme).

Requirements

  • PHP 8.3+
  • Symfony 7.0 or 8.0

Installation

Install with Composer:

composer require jmf/twig-tabs-bundle

If you have Symfony Flex, the tabs() / tab() functions are instantly available without further configuration. Otherwise, register the bundle in config/bundles.php:

<?php

return [
    // ...
    Jmf\TwigTabsBundle\JmfTwigTabsBundle::class => ['all' => true],
];

Quick Start

Use the tabs() and tab() functions in any Twig template:

{{ tabs(
    tab('articles').label('First tab').content('<p>Content 1</p>'),
    tab('authors').label('Second tab').include('path/to/template.html.twig', {foo: bar}),
    tab('comments').label('With badge').content('<p>Content 3</p>').badge('5'),
) }}

Or pass an array of builders:

{{ tabs(myTabBuilders) }}

tab() builder methods

Method Description
.label(string $label) Tab header label
.content(string $html) Raw HTML content for the tab pane
.include(string $path, array $parameters) Render a template as the tab pane content
.badge(?string $badge) Optional badge displayed next to the label

Configuration Reference

All settings are optional. Create config/packages/jmf_twig_tabs.yaml to override the defaults:

jmf_twig_tabs:

    # Optional prefix before the "tabs" and "tab" function names. Default: ''
    # Example: 'jmf_' registers 'jmf_tabs' / 'jmf_tab' instead of 'tabs' / 'tab'.
    prefix: ''

    # Twig template used as the rendering entry point. Default: '@JmfTwigTabs/bootstrap/tabs.html.twig'
    template_path: '@JmfTwigTabs/bootstrap/tabs.html.twig'

A sample configuration file is available in the samples/ directory.

Customising templates

The @JmfTwigTabs namespace is registered automatically and points at the Bootstrap templates shipped by jmf/twig-tabs. To customise the markup, either set template_path to your own entry point, or override the namespaced templates (tabs.html.twig, nav-tabs.html.twig, nav-item.html.twig, tab-content.html.twig, tab-pane.html.twig) from your application.

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: mit
  • 更新时间: 2026-05-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固