Skip to content

Commit

Permalink
Update alter-twig.php
Browse files Browse the repository at this point in the history
  • Loading branch information
lal65 authored Jan 26, 2024
1 parent 02be832 commit db5f248
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions alter-twig.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ function moveKeyBefore($arr, $find, $move) {

function addCustomExtension(Environment $env) {
$env->addExtension(new SmartDatetimeExtension);
$env->addFilter(new TwigFilter('clean_unique_id', function($id) { return $id . '-' . uniqid(); }));

$env->addFilter(new TwigFilter('clean_unique_id', function($id) {
$id = str_replace(' ', '-', $id);
return $id . '-' . uniqid();
}));
$env->addFunction(new TwigFunction('get_component_stylesheets', function () {
$manifests = [];
foreach (glob('node_modules/@psu-ooe/*/package.json') as $manifest) {
Expand Down

0 comments on commit db5f248

Please sign in to comment.