C
C
CoolBatman2732017-08-18 20:47:19
Twig
CoolBatman273, 2017-08-18 20:47:19

Why does the Uncaught Error: Class 'Twig_Loader_Filesystem' not found error appear?

After this code eed560055e8c494f827a7092e54c17a9.png
, the following error appears
28300eda479248bea1575dea0872cf98.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Dmitriev, 2019-03-22
@iworkup

In general, Twig has changed something in its logic... I started copy-pasting the code from the old project to the new one and also encountered this error.
It turned out that now you need to connect:

$loader = new \Twig\Loader\FilesystemLoader('...');
$twig = new \Twig\Environment($loader);

I
Ilya Beloborodov, 2017-08-18
@kowap

Where is the Twig folder? If at the root, then connect it like that?
and you need to insert the code, I'm not an editor to screen

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question