CompilesHelpers.php 982B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace Illuminate\View\Compilers\Concerns;
  3. trait CompilesHelpers
  4. {
  5. /**
  6. * Compile the CSRF statements into valid PHP.
  7. *
  8. * @return string
  9. */
  10. protected function compileCsrf()
  11. {
  12. return '<?php echo csrf_field(); ?>';
  13. }
  14. /**
  15. * Compile the "dd" statements into valid PHP.
  16. *
  17. * @param string $arguments
  18. * @return string
  19. */
  20. protected function compileDd($arguments)
  21. {
  22. return "<?php dd{$arguments}; ?>";
  23. }
  24. /**
  25. * Compile the "dump" statements into valid PHP.
  26. *
  27. * @param string $arguments
  28. * @return string
  29. */
  30. protected function compileDump($arguments)
  31. {
  32. return "<?php dump{$arguments}; ?>";
  33. }
  34. /**
  35. * Compile the method statements into valid PHP.
  36. *
  37. * @param string $method
  38. * @return string
  39. */
  40. protected function compileMethod($method)
  41. {
  42. return "<?php echo method_field{$method}; ?>";
  43. }
  44. }