【问题标题】:Adding third party class in Drupal 8在 Drupal 8 中添加第三方类
【发布时间】:2016-04-29 13:24:25
【问题描述】:

我正在尝试将 PHRETS 类添加到 Drupal 8 (https://github.com/troydavisson/PHRETS)。我在 drupal 7 中通过简单地包含 autoload.php 文件并调用类名来做到这一点。但是 Drupal 8 不允许这样做。它需要以 PSR-4 格式声明类。 PHRETS 有很多课程。有没有其他方法可以直接调用这个类,就像我在 Drupal 7 中使用的那样:

use PHRETS\Configuration;
require_once("vendor/autoload.php");

【问题讨论】:

    标签: drupal drupal-8


    【解决方案1】:

    Composer Manager 模块处理 Composer 管理的第三方库的自动加载。该模块的用法在its documentation 中介绍。

    【讨论】:

      猜你喜欢
      • 2013-05-27
      • 2017-01-22
      • 1970-01-01
      • 1970-01-01
      • 2019-01-09
      • 1970-01-01
      • 2017-08-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多