This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Error while using Mpdf and pdf download

Hi,

I am trying to download content in pdf.

I have done composer require mpdf/mpdf

Then in my code I have used the following:

use \Mpdf\Mpdf;

$mpdf = new Mpdf();

$filename = 'file.pdf';

$mpdf->Output($filename, 'D');

But I am getting error Class 'Mpdf\Mpdf' not found in Drupal. Following some forums I have tried using 

$mpdf = new mPDF()

Embed Vue.js app in Drupal loading as a library.

I wanted to create a small app in Vue.js and display it in my Drupal site. The motivation to embed an app in the twig template is possibility to better integrate with other elements of the site (e.g. navigation bar, footer, etc.) making navigation through the app-embedded page seamless to the user.

D8 block visibility and caching

I want to hide a block under certain conditions. The code works, but only if I flush the caches after the condition changes. I guess I have to do something with the cachablity of the block, but I'm not sure how. Any ideas?

Here's the code:

How to query an external, non-drupal Database

Hey,

I want to query an external sqlite Database. This Database does not contain Drupal information, or Drupal specific tables. It jus holds some data, I want to display on my website.

How can I integrate the database?

So far, I added it to setting.php:

$databases['external']['default'] = [
  'driver' => 'sqlite',
  'database' => '/gesamtausgabe_2019.sqlite',
];

And then, I try to call it in my Controller.php file:

question about inject core service in custom class.

HI:

I‘m little confusing about the injection of core services in my class.

I have a module, named with helloworld. And in the helloworld.service.yml  file ,i have the service defined like this:

services:
  HelloWorld.salutation:
    class: Drupal\helloworld\HelloWorldSalutation
    arguments: ['@current_user', '@config.factory']

In my HelloWorldSalutation class ,i have a __construct() function to inject the core services:

Can you help me create a module that lists user tasks ?

Hi, I want to create a module that lists the user tasks, for the entities "User", "Drupal Commerce" and "Group".

I have a Drupal 8.9 site with the Drupal Commerce and Group modules :

https://www.drupal.org/project/commerce

https://www.drupal.org/project/group

I want to create a task list on the following pages :

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions