diff --git a/src/directives.php b/src/directives.php index 41b1f6a..6a37cc1 100644 --- a/src/directives.php +++ b/src/directives.php @@ -234,7 +234,7 @@ 'pushonce' => function ($expression) { list($pushName, $pushSub) = explode(':', trim(substr($expression, 1, -1))); - $key = '__pushonce_'.$pushName.'_'.$pushSub; + $key = '__pushonce_'.$pushName.'_'.str_replace('-', '_', $pushSub); return "{$key})): \$__env->{$key} = 1; \$__env->startPush('{$pushName}'); ?>"; },