HtmlString.php 699B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace Illuminate\Support;
  3. use Illuminate\Contracts\Support\Htmlable;
  4. class HtmlString implements Htmlable
  5. {
  6. /**
  7. * The HTML string.
  8. *
  9. * @var string
  10. */
  11. protected $html;
  12. /**
  13. * Create a new HTML string instance.
  14. *
  15. * @param string $html
  16. * @return void
  17. */
  18. public function __construct($html)
  19. {
  20. $this->html = $html;
  21. }
  22. /**
  23. * Get the HTML string.
  24. *
  25. * @return string
  26. */
  27. public function toHtml()
  28. {
  29. return $this->html;
  30. }
  31. /**
  32. * Get the HTML string.
  33. *
  34. * @return string
  35. */
  36. public function __toString()
  37. {
  38. return $this->toHtml();
  39. }
  40. }