Неизвестная функция «актив» - Symfony 3 - PullRequest
0 голосов
/ 28 декабря 2018

Я перенес проект с Symfony 2.8 на 3.4.20 , но, похоже, проблема с сборкой вообще не обнаружена.

Я продолжаю получать сообщение:

Вы забыли запустить "composer Требуется Symfony / asset"?Неизвестная функция "asset".

Я установил symfony / asset, но это ничего не изменило.

Вот мой config.yml

framework:
    templating:
        engines: ['twig']
    assets: ~

twig:
    debug:            "%kernel.debug%"
    strict_variables: "%kernel.debug%"

assetic:
    debug:          "%kernel.debug%"
    use_controller: "%kernel.debug%"
    bundles:
        - FOSUserBundle
        - MobiliteMainBundle
        - MobiliteUserBundle
    filters:
        cssrewrite: ~
    twig:
        functions:
            cssrewrite: ~

Вот composer.json

{
  "name": "symfony/framework-standard-edition",
  "license": "MIT",
  "type": "project",
  "description": "FOS Mobilite",
  "autoload": {
    "psr-4": {
      "Mobilite\\MainBundle\\": "src/Mobilite/MainBundle",
      "Mobilite\\UserBundle\\": "src/Mobilite/UserBundle"
    },
    "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
  },
  "require": {
    "php": ">=7.2",
    "artscorestudio/datagrid-bundle": "^3.0",
    "doctrine/doctrine-bundle": "^1.6",
    "doctrine/doctrine-fixtures-bundle": ">=2.2.0",
    "doctrine/orm": "^2.5",
    "friendsofsymfony/user-bundle": "^2.1",
    "incenteev/composer-parameter-handler": "^2.0",
    "knplabs/knp-menu-bundle": ">=2.1.1",
    "knplabs/knp-snappy-bundle": ">=1.4",
    "paragonie/random_compat": "v2.0.17",
    "phpoffice/phpexcel": ">=1.8.1",
    "sensio/distribution-bundle": "^5.0.19",
    "sensio/framework-extra-bundle": "^5.0.0",
    "symfony/asset": "v3.4.20",
    "symfony/assetic-bundle": "^2.8",
    "symfony/monolog-bundle": ">=2.4",
    "symfony/swiftmailer-bundle": ">=2.3",
    "symfony/symfony": "3.4.*",
    "symfony/twig-bridge": "v3.4.20",
    "twig/extensions": ">=1.3.0",
    "twig/twig": "^1.0||^2.0",
    "white-october/pagerfanta-bundle": ">=v1.0.5"
  },
  "require-dev": {
    "sensio/generator-bundle": "^3.0",
    "symfony/phpunit-bridge": "^3.0"
  },
  "scripts": {
    "symfony-scripts": [
      "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
      "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
    ],
    "post-install-cmd": [
      "@symfony-scripts"
    ],
    "post-update-cmd": [
      "@symfony-scripts"
    ]
  },
  "config": {
    "platform": {
      "php": "7.2"
    },
    "sort-packages": true
  },
  "extra": {
    "symfony-app-dir": "app",
    "symfony-bin-dir": "bin",
    "symfony-var-dir": "var",
    "symfony-web-dir": "web",
    "symfony-tests-dir": "tests",
    "symfony-assets-install": "relative",
    "incenteev-parameters": {
      "file": "app/config/parameters.yml"
    },
    "branch-alias": {
      "dev-master": "3.4-dev"
    }
  }
}

И вот как я загружаю свой CSS

{% block stylesheets %}
    {% stylesheets
        '@MobiliteMainBundle/Resources/public/css/bootstrap.min.css'
        '@MobiliteMainBundle/Resources/public/css/bootstrap-theme.min.css'
        '@MobiliteMainBundle/Resources/public/css/jquery-ui-1.10.4.custom.min.css'
        '@MobiliteMainBundle/Resources/public/css/bootstrap-glyphicons.css'
        '@MobiliteMainBundle/Resources/public/css/global.css'
        '@MobiliteMainBundle/Resources/public/css/Desktop/select/select2.min.css'
        filter='cssrewrite' %}
        <link rel="stylesheet" href="{{ asset_url }}" />
    {% endstylesheets %}
{% endblock %}
...