EFTEC / BladeOne

The standalone version Blade Template Engine without Laravel in a single php file and without dependencies
https://www.escuelainformatica.cl/
Other
782 stars 120 forks source link

Error @stack #199

Open Ryzz123 opened 3 weeks ago

Ryzz123 commented 3 weeks ago

@stack('scripts-head')

-#1Z#-#2B#scripts-head,#3R#-#4X#-

xavier-arthur commented 4 days ago

I'm having the same issue and it appears to have been introduced in version 4.16. The problem is related to the following code:

/**
 * Compile the stack statements into the content.
 *
 * @param string $expression
 * @return string
 * @see BladeOne::yieldPushContent
 */
protected function compileStack($expression): string
{
    return $this->phpTagEcho . " \$this->CompileStackFinal$expression; ?>";
}

public function CompileStackFinal($a = null, $b = null): string
{
    return $this->escapeStack0 . $a . ',' . $b . $this->escapeStack1;
}

The CompileStackFinal method is concatenating the regex defined at the top of the class with the @stack expression, but it does not seem to actually push any content to the stack.

I'll look into this further and try to identify a fix. If I manage to resolve it, I'll submit a pull request.