You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Theres occurring a problem.
This library relies on the Twig_Extension Bundle.
But the Twig/Extensions Bundle is abandoned.
"WARNING: This repository is abandoned in favor of Twig Core Extra extensions."
Source: https://github.com/twigphp/Twig-extensions
The function, that this bundle here is using isn't in the Twig Core Extra extension:
"DateExtension: time_diff filter -> no equivalent"
Has anybody a solution how to make this bundle (or a similar bundle) compatible?
Really, timeago.js may be part of the solution here. But I'm unclear on what the best practices are using Webpack Encore and requiring a javascript library in a bundle.
What I've been doing is
yarn add timeago
Then
Any idea on how to require a js library from within a Symfony Bundle, and integrate it (automatically?). Then the twig extension becomes easy, at least for that part.
$ composer require knplabs/knp-time-bundle
Using version ^1.10 for knplabs/knp-time-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.0.*"
Nothing to install or update
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 255
!!
!! // Clearing the cache for the dev environment with debug
!! // true
!!
!! 14:19:35 CRITICAL [php] Uncaught Error: Class 'Twig_Extension' not found ["exception" => Error { …}]
!!
!! In TimeExtension.php line 20:
!!
!! Attempted to load class "Twig_Extension" from the global namespace.
!! Did you forget a "use" statement?
!!
!!
!! cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>
!!
!!
Script @auto-scripts was called via post-update-cmd
Installation failed, reverting ./composer.json to its original content.
$ composer require knplabs/knp-time-bundle
Using version ^1.10 for knplabs/knp-time-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.0.*"
Nothing to install or update
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 255
!!
!! // Clearing the cache for the dev environment with debug
!! // true
!!
!! 14:19:35 CRITICAL [php] Uncaught Error: Class 'Twig_Extension' not found ["exception" => Error { …}]
!!
!! In TimeExtension.php line 20:
!!
!! Attempted to load class "Twig_Extension" from the global namespace.
!! Did you forget a "use" statement?
!!
!!
!! cache:clear [--no-warmup] [--no-optional-warmers] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--]
!!
!!
Script @auto-scripts was called via post-update-cmd
Installation failed, reverting ./composer.json to its original content.
Thats because you need to install twig extension bundle (composer require twig/extensions)
But Twig Extension Bundle is incompatible with SF5 ("Your requirements could not be resolved to an installable set of packages.")
So this knp time bundle can't be installed right now.
Activity
mikeploeger commentedon Dec 5, 2019
+1
mikeploeger commentedon Dec 5, 2019
Theres occurring a problem.
This library relies on the Twig_Extension Bundle.
But the Twig/Extensions Bundle is abandoned.
"WARNING: This repository is abandoned in favor of Twig Core Extra extensions."
Source: https://github.com/twigphp/Twig-extensions
The function, that this bundle here is using isn't in the Twig Core Extra extension:
"DateExtension: time_diff filter -> no equivalent"
Has anybody a solution how to make this bundle (or a similar bundle) compatible?
tacman commentedon Dec 5, 2019
Really, timeago.js may be part of the solution here. But I'm unclear on what the best practices are using Webpack Encore and requiring a javascript library in a bundle.
What I've been doing is
Then
Any idea on how to require a js library from within a Symfony Bundle, and integrate it (automatically?). Then the twig extension becomes easy, at least for that part.
napestershine commentedon Dec 29, 2019
mikeploeger commentedon Dec 29, 2019
Thats because you need to install twig extension bundle (composer require twig/extensions)
But Twig Extension Bundle is incompatible with SF5 ("Your requirements could not be resolved to an installable set of packages.")
So this knp time bundle can't be installed right now.
weaverryan commentedon Dec 30, 2019
Should be better in v1.11.0. If you have any problems, please open a new issue :)