• Hello, after updating to version 2.X, the customized pdf template cannot show up.

    use FluentForm\App\Services\FormBuilder\ShortCodeParser;
    use FluentForm\Framework\Foundation\Application;

    class certificate extends \FluentFormPdf\Classes\Templates\TemplateManager
    {
    public function __construct(Application $app)
    {
    parent::__construct($app);
    }

    public function getDefaultSettings() { return ['header' => '', 'footer' => '', 'body' => '']; }
    public function getSettingsFields() { return array(); }

    public function generatePdf($submissionId, $feed, $outPut = 'I', $fileName = '')
    {
    $submission = wpFluent()->table('fluentform_submissions')->where('id', $submissionId)->first();
    $response = json_decode($submission->response, true);





    $htmlBody = '

    <div class="description">
    test test test
    </div>
    ';

    if (!$fileName) {
    $fileName = 'certificate -' . $submissionId;
    }

    return $this->pdfBuilder($fileName, $feed, $htmlBody, '', $outPut);
    }
    }

    error message as below

    Uncaught Error: Class \”FluentFormPdf\Classes\Templates\TemplateManager\” not found in /var/www/wp-content/uploads/FLUENT_PDF_TEMPLATES/certificate.php on line 6″,”data”:{“message”:”Uncaught Error: Class \”FluentFormPdf\Classes\Templates\TemplateManager\” not found”,”file”:”/var/www/guide/event/wp-content/uploads/FLUENT_PDF_TEMPLATES/certificate.php”,”line”:6,”trace”:[{“file”:”/var/www/wp-content/plugins/insert-headers-and-footers/includes/class-wpcode-snippet-execute.php(419) : eval()’d code”,”line”:24,”function”:”include_once”}

    But the code runs well in version 1.111

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,
    Sorry for the trouble you are facing.

    This is a due namespace change in v2. We will add backward compatibility in the next patch (v2.1.1) — custom templates using the old FluentFormPdf\Classes\Templates\TemplateManager class will work automatically.

    In the meantime, you can fix it immediately by changing line 6 of your certificate.php from:
    class certificate extends \FluentFormPdf\Classes\Templates\TemplateManager
    to:
    class certificate extends \FluentPdf\Modules\FluentForms\Templates\TemplateManager

    Hope that change will fix your issue.

    Thread Starter websterhung

    (@websterhung)

    Thank you!

    It worked!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.