0

目前我尝试将此 PHP 电子表格包用于 Symfony 4: https ://github.com/roromix/SpreadsheetBundle

但是我尝试使用这个捆绑包没有成功。找不到它作为服务(php bin/console debug:autowiring),下面的方法也是错误的。

<?php
namespace App\Controller;

use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Roromix\Bundle\SpreadsheetBundle\RoromixSpreadsheetBundle;

class TranslationController extends Controller
{
    /**
     * @Route("/")
     */
    public function index()
    {
        $RoromixSpreadsheetBundle = new RoromixSpreadsheetBundle();

    //...
    }
}

?>
4

1 回答 1

0

我认为在您的控制器中获得服务:

dump($this->get('phpspreadsheet'));

因为服务名称为phpspreadsheethttps ://github.com/roromix/SpreadsheetBundle/blob/master/src/Resources/config/services.yml

于 2018-03-02T16:29:08.943 回答