TinyButStrong OPentbs + Symfony 4 - PullRequest
       24

TinyButStrong OPentbs + Symfony 4

0 голосов
/ 12 июня 2019

Я использую opentbs в приложении Symfony 4 для загрузки файла odt. это то, что я делаю, но в opentbs службы в Symfony есть проблема, которую я не нахожу решением этой проблемы

/**
     * @param Project $project
     * @param OpenTBS $openTBS
     * @return string|BinaryFileResponse
     * @ParamConverter("analyse", options={"mapping": {"id"   : "id"}})
     * @SWG\Parameter(name="id", in="path", type="integer", description="Supplier Id"))
     * @SWG\Response(response=200, description="Return listScoreAnalyses")
     *
     * @Rest\Get("rapports/{id}/rapport")
     */
    public function getRapportAction(Project $project, OpenTBS $openTBS)
    {

        // get the service
        $TBS = $this->container->get('opentbs');
        // load your template
        $template = '/home/ke/Documents/test.odt';
        $TBS->LoadTemplate($template, OPENTBS_ALREADY_UTF8);
        // remplace les variables
        $TBS -> MergeField ( ' client ' , array ( ' name ' => ' Ford Prefect ' ));
        // envoie le fichier
        $openTBS -> Show ( OPENTBS_DOWNLOAD , 'test.odt ' );

    }

это ошибка

 "message": "Cannot autowire argument $openTBS of \"App\\Controller\\RapportController::getRapportAction()\": it references class \"MBence\\OpenTBSBundle\\Services\\OpenTBS\" but no such service exists. You should maybe alias this class to the existing \"opentbs\" service.",

а это моя модель

... some text in a word file with a `[client.name]` variable ...
...