actiview/magento2-easy-routes 问题修复 & 功能扩展

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

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

actiview/magento2-easy-routes

最新稳定版本:1.0.3

Composer 安装命令:

composer require actiview/magento2-easy-routes

包简介

Create multi-language custom routes with ease

README 文档

README

Create multi-language custom routes with ease, including layout handle for easy templating.

Installation

Install this package through Composer and then enable the module for Magento 2.

composer require actiview/magento2-easy-routes
bin/magento module:enable Actiview_EasyRoutes

Usage

Adding a route involves a few easy steps, these steps are explained below. Have a look at the sample module: Actiview_EasyRoutesSample for the complete setup.

A new route is added to the routes pool through a etc/frontend/di.xml file. This file can be added in a custom module or one of you existing project modules.

Virtual Type

First create a virtualType:

    <virtualType name="SamplePageEasyRoute" type="Actiview\EasyRoutes\Model\AbstractEasyRoute">
        <arguments>
            <argument name="routeId" xsi:type="string">sample-page</argument>
            <argument name="storePaths" xsi:type="array">
                <item name="" xsi:type="string">sample-page</item>
            </argument>
        </arguments>
    </virtualType>

To add multiple (multi-language) paths for the same ID use the next sample. The default route can be named default or the name can be empty. For the other paths use the relevant store code as name.

    <virtualType name="SamplePageEasyRoute" type="Actiview\EasyRoutes\Model\AbstractEasyRoute">
        <arguments>
            <argument name="routeId" xsi:type="string">sample-page</argument>
            <argument name="storePaths" xsi:type="array">
                <item name="" xsi:type="string">sample-page</item>
                <item name="nl" xsi:type="string">voorbeeldpagina</item>
                <item name="de" xsi:type="string">beispielseite</item>
                <item name="fr" xsi:type="string">page-d-exemple</item>
                <item name="es" xsi:type="string">pagina-de-muestra</item>
            </argument>
        </arguments>
    </virtualType>

Paths

Now the new route is available for the router and the page can be visited:

When one of these pages is visited an additional layout handle will be added: easy_routes_sample-page. This can be used to apply additional or custom templating.

Usage (advanced)

You can provide your own CustomRoute object that implements EasyRouteInterface. Now you can provide your own logic, for exampling enableing/disabling a route for a store view.

Bugs / feature requests

Please use the GitHub Issue Tracker to report bugs or feature requests.

Versions

v.1.0.0

Initial release

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-12-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固