CompilesComments.php 413B

1234567891011121314151617181920
  1. <?php
  2. namespace Illuminate\View\Compilers\Concerns;
  3. trait CompilesComments
  4. {
  5. /**
  6. * Compile Blade comments into an empty string.
  7. *
  8. * @param string $value
  9. * @return string
  10. */
  11. protected function compileComments($value)
  12. {
  13. $pattern = sprintf('/%s--(.*?)--%s/s', $this->contentTags[0], $this->contentTags[1]);
  14. return preg_replace($pattern, '', $value);
  15. }
  16. }