定制 scandipwa/route717 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

scandipwa/route717

最新稳定版本:2.1.6

Composer 安装命令:

composer require scandipwa/route717

包简介

ScandiPWA dedicated router

README 文档

README

Module is providing custom router to properly resolve HTTP codes on specific page request.

v1.1.0 update

Custom router is now checking theme type in order to support URL rewrites. You must ensure PWA theme type is set to 4 to utilize the options.

Installer is doing this automatically for any newly generated theme.

For already generated theme please update manually: set PWA theme type to 4 in theme table.

Installation

composer require scandipwa/route717

Description

Module is providing validators for such entities:

  1. Product (/product)
  2. Category (/category)
  3. Cms pages (/page)
  4. Cart (/cart)
  5. Root (/)

How it works

Each frontend path (Magento 2 front name) should be added to validator list in src/etc/di.xml. Depending on entity type it might have more or less complex validation logic, to i.e. determine if specific product exists or not. Router is only responding 200 OK to entities, which it was able to validate. Otherwise it is falling back to default Magento 2 routers.

Customization

To add new path you must provide your own validator, that must implement ScandiPWA\Router\ValidatorInterface and register it as an array element passed to ScandiPWA\Router\ValidationManager using di.xml.

Accessing Magento 2 default routes

In order to allow Magento 2 to handle some routes in default manner (only serverside functionality) you must allow specific routes to be accessed by adding RegExp to src/app/etc/di.xml::ignoredURLs arguments list.

So far there are 3 paths whitelisted out of the box:

  • /newsletter/subscriber/confirm - subscribe to newsletter
  • /newsletter/subscriber/unsubscribe - unsubscribe to newsletter
  • /customer/account/confirm/ - confirm e-mail (redirect to homepage in any case, modify according to your needs)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: OSL-3.0
  • 更新时间: 2019-03-26