v1.0.0 initial release
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\View\Compilers\Concerns;
|
||||
|
||||
trait CompilesFragments
|
||||
{
|
||||
/**
|
||||
* The last compiled fragment.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $lastFragment;
|
||||
|
||||
/**
|
||||
* Compile the fragment statements into valid PHP.
|
||||
*
|
||||
* @param string $expression
|
||||
* @return string
|
||||
*/
|
||||
protected function compileFragment($expression)
|
||||
{
|
||||
$this->lastFragment = trim($expression, "()'\" ");
|
||||
|
||||
return "<?php \$__env->startFragment{$expression}; ?>";
|
||||
}
|
||||
|
||||
/**
|
||||
* Compile the end-fragment statements into valid PHP.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function compileEndfragment()
|
||||
{
|
||||
return '<?php echo $__env->stopFragment(); ?>';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user