0

我有带有 EasyAdmin 3.2.7 的 Symfony5.2,我正在尝试添加自定义 Web 资产,如此处所述https://symfony.com/doc/current/bundles/EasyAdminBundle/design.html#adding-custom-web-资产。但是由于某些奇怪的原因,在我的文件 vendor/easycorp/easyadmin-bundle/src/Config/Assets.php 中没有方法addWebpackEncoreEntry。有方法__construct, new, addCssFile, addJsFile, addHtmlContentToHead, addHtmlContentToBody, , 仅getAsDto此而已。

同时,在这里https://github.com/EasyCorp/EasyAdminBundle/blob/master/src/Config/Assets.php#L27我看到了这个方法。

我的 EasyAdmin 由 Composer 安装。我试图删除 EasyAdmin 并运行composer update. 结果是一样的。

我的 composer.json 是:

{
  "type": "project",
  "license": "proprietary",
  "minimum-stability": "dev",
  "prefer-stable": true,
  "require": {
    "php": ">=7.4",
    "ext-ctype": "*",
    "ext-iconv": "*",
    "ext-json": "*",
    "composer/package-versions-deprecated": "1.11.99.1",
    "doctrine/annotations": "^1.0",
    "doctrine/doctrine-bundle": "^2.2",
    "doctrine/doctrine-migrations-bundle": "^3.0",
    "doctrine/orm": "^2.8",
    "easycorp/easyadmin-bundle": "^3.2",
    "phpdocumentor/reflection-docblock": "^5.2",
    "sensio/framework-extra-bundle": "^5.1",
    "serendipity_hq/bundle-users": "dev-dev",
    "symfony/asset": "5.2.*",
    "symfony/console": "5.2.*",
    "symfony/dotenv": "5.2.*",
    "symfony/expression-language": "5.2.*",
    "symfony/flex": "^1.3.1",
    "symfony/form": "5.2.*",
    "symfony/framework-bundle": "5.2.*",
    "symfony/http-client": "5.2.*",
    "symfony/intl": "5.2.*",
    "symfony/mailer": "5.2.*",
    "symfony/mime": "5.2.*",
    "symfony/monolog-bundle": "^3.1",
    "symfony/notifier": "5.2.*",
    "symfony/process": "5.2.*",
    "symfony/property-access": "5.2.*",
    "symfony/property-info": "5.2.*",
    "symfony/proxy-manager-bridge": "5.2.*",
    "symfony/security-bundle": "5.2.*",
    "symfony/serializer": "5.2.*",
    "symfony/string": "5.2.*",
    "symfony/translation": "5.2.*",
    "symfony/twig-bundle": "^5.2",
    "symfony/validator": "5.2.*",
    "symfony/web-link": "5.2.*",
    "symfony/webpack-encore-bundle": "^1.9",
    "symfony/yaml": "5.2.*",
    "twig/extra-bundle": "^2.12|^3.0",
    "twig/twig": "^2.12|^3.0"
  },
  "require-dev": {
    "symfony/browser-kit": "^5.2",
    "symfony/css-selector": "^5.2",
    "symfony/debug-bundle": "^5.2",
    "symfony/maker-bundle": "^1.0",
    "symfony/phpunit-bridge": "^5.2",
    "symfony/stopwatch": "^5.2",
    "symfony/var-dumper": "^5.2",
    "symfony/web-profiler-bundle": "^5.2"
  },
  "config": {
    "optimize-autoloader": true,
    "preferred-install": {
      "*": "dist"
    },
    "sort-packages": true
  },
  "autoload": {
    "psr-4": {
      "App\\": "src/"
    }
  },
  "autoload-dev": {
    "psr-4": {
      "App\\Tests\\": "tests/"
    }
  },
  "replace": {
    "symfony/polyfill-ctype": "*",
    "symfony/polyfill-iconv": "*",
    "symfony/polyfill-php72": "*"
  },
  "scripts": {
    "auto-scripts": {
      "cache:clear": "symfony-cmd",
      "assets:install %PUBLIC_DIR%": "symfony-cmd"
    },
    "post-install-cmd": [
      "@auto-scripts"
    ],
    "post-update-cmd": [
      "@auto-scripts"
    ]
  },
  "conflict": {
    "symfony/symfony": "*"
  },
  "extra": {
    "symfony": {
      "allow-contrib": false,
      "require": "5.2.*"
    }
  }
}

这怎么可能?我能用它做什么?

4

0 回答 0