WowPress-Tailwind/theme/vendor/illuminate/view/Compilers/Concerns/CompilesJs.php

23 lines
447 B
PHP
Raw Permalink Normal View History

2024-04-15 23:07:29 +02:00
<?php
namespace Illuminate\View\Compilers\Concerns;
use Illuminate\Support\Js;
trait CompilesJs
{
/**
* Compile the "@js" directive into valid PHP.
*
* @param string $expression
* @return string
*/
protected function compileJs(string $expression)
{
return sprintf(
"<?php echo \%s::from(%s)->toHtml() ?>",
Js::class, $this->stripParentheses($expression)
);
}
}