nepada/presenter-mapping 问题修复 & 功能扩展

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

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

nepada/presenter-mapping

最新稳定版本:v2.6.0

Composer 安装命令:

composer require nepada/presenter-mapping

包简介

Improved presenter mapping for PresenterFactory from Nette.

README 文档

README

Build Status Coverage Status Downloads this Month Latest stable

Installation

Via Composer:

$ composer require nepada/presenter-mapping

Register the extension in config.neon:

extensions: - Nepada\Bridges\PresenterMappingDI\PresenterMappingExtension

Usage

The extension replaces standard PresenterFactory provided by ApplicationExtension and adds extended support for presenter mapping. The new presenter mapping system is fully compatible with simple mapping from Nette.

Submodule mapping

Nette supports mapping based only on the root module name, this package adds support for separate mapping for submodules. You can define different mapping for submodule Foo:Bar and it will take precendence over the mapping defined for Foo and * respectively.

Example:

application: mapping: '*': ['App', 'Module\*', 'Presenter\*'] 'Foo': Foo\*Module\*Presenter 'Foo:Bar': Bar\*Module\*Presenter

Presenter class mapping

You can define mapping between presenter name and class directly for individual presenters. This is especially useful when you need to override a single presenter from a module provided for example by external composer package.

Example:

application: mapping: 'Foo:Bar:Baz': FooBar\BazPresenter

Configuration from another CompilerExtension

Some extensions may need to setup their own presenter mappings, this can be done in beforeCompile() phase by customizing setup of PresenterMapper.

$presenterMapper = $containerBuilder->getByType(Nepada\PresenterMapping\PresenterMapper::class); $containerBuilder->getDefinition($presenterMapper) ->addSetup('setPresenterMapping', ['Foo:Bar:Baz', FooBar\BazPresenter::class]) ->addSetup('setModuleMapping', ['Foo:Bar', 'Bar\*Module\*Presenter']) ->addSetup('setModuleMapping', ['Foo', 'Foo\*Module\*Presenter']);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固