KnpLabs / KnpLabs/KnpTimeBundle

Twig addExtension Uncaught Twig\Error\RuntimeError

Open
#203 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
625
Forks
103
PR merge metrics
No merged PRs in 30d

Description

Hi,

Maybe I'm doing something wrong, but I can't tell from the description. I add the time extension to Twig, but then I get an Uncaught Twig\Error\RuntimeError error.

$twig->addExtension(new \Knp\Bundle\TimeBundle\Twig\Extension\TimeExtension());

Uncaught Twig\Error\RuntimeError: Unable to load the "Knp\Bundle\TimeBundle\DateTimeFormatter" runtime in "__string_template_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported addExtension call with Knp\Bundle\TimeBundle\Twig\Extension\TimeExtension and inspect the attempted loading of Knp\Bundle\TimeBundle\DateTimeFormatter. Confirm whether the runtime error is caused by the documented setup or an incompatibility, and make the extension load successfully without the reported RuntimeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, symfony
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.