从字面上看,它被翻译成...
<?php echo $__env->make('sidebar.pages', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
所以在你的尝试列表中,最近的可能是
<?php echo render('sidebar.pages', array_except(get_defined_vars(), array('__data', '__path'))); ?>
参考:View\Compilers\BladeCompiler
/**
* Compile Blade include statements into valid PHP.
*
* @param string $value
* @return string
*/
protected function compileIncludes($value)
{
$pattern = $this->createOpenMatcher('include');
$replace = '$1<?php echo $__env->make$2, array_except(get_defined_vars(), array(\'__data\', \'__path\')))->render(); ?>';
return preg_replace($pattern, $replace, $value);
}
/**
* Get the regular expression for a generic Blade function.
*
* @param string $function
* @return string
*/
public function createOpenMatcher($function)
{
return '/(?<!\w)(\s*)@'.$function.'(\s*\(.*)\)/';
}