MessagingResponse.php 949 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * This code was generated by
  4. * \ / _ _ _| _ _
  5. * | (_)\/(_)(_|\/| |(/_ v1.0.0
  6. * / /
  7. */
  8. namespace Twilio\TwiML;
  9. class MessagingResponse extends TwiML {
  10. /**
  11. * MessagingResponse constructor.
  12. */
  13. public function __construct() {
  14. parent::__construct('Response');
  15. }
  16. /**
  17. * Add Message child.
  18. *
  19. * @param string $body Message Body
  20. * @param array $attributes Optional attributes
  21. * @return TwiML Child element.
  22. */
  23. public function message($body, $attributes = array()) {
  24. return $this->nest(new Messaging\Message($body, $attributes));
  25. }
  26. /**
  27. * Add Redirect child.
  28. *
  29. * @param url $url Redirect URL
  30. * @param array $attributes Optional attributes
  31. * @return TwiML Child element.
  32. */
  33. public function redirect($url, $attributes = array()) {
  34. return $this->nest(new Messaging\Redirect($url, $attributes));
  35. }
  36. }