/demos/Zend/Service/LiveDocx/MailMerge/constructors/public.php

https://github.com/decaoz/zf1 · PHP · 58 lines · 41 code · 15 blank · 2 comment · 0 complexity · 9ba6e2803969310bbc10ef44e1e6cacb MD5 · raw file

  1. <?php
  2. require_once dirname(__FILE__) . '/../../common.php';
  3. system('clear');
  4. print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
  5. PHP_EOL . 'Using the Free Public Server' .
  6. PHP_EOL .
  7. PHP_EOL . 'This sample application illustrates how to use Zend_Service_LiveDocx_MailMerge with the free, public LiveDocx server.' .
  8. PHP_EOL .
  9. PHP_EOL)
  10. );
  11. $mailMerge = new Zend_Service_LiveDocx_MailMerge();
  12. $mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
  13. ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
  14. $mailMerge->getTemplateFormats(); // then call methods as usual
  15. printf('Username : %s%sPassword : %s%s WSDL : %s%s%s',
  16. $mailMerge->getUsername(),
  17. PHP_EOL,
  18. $mailMerge->getPassword(),
  19. PHP_EOL,
  20. $mailMerge->getWsdl(),
  21. PHP_EOL,
  22. PHP_EOL
  23. );
  24. unset($mailMerge);
  25. // -----------------------------------------------------------------------------
  26. // Alternatively, you can pass username and password in the constructor.
  27. $mailMerge = new Zend_Service_LiveDocx_MailMerge(
  28. array (
  29. 'username' => DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME,
  30. 'password' => DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD,
  31. )
  32. );
  33. $mailMerge->getTemplateFormats(); // then call methods as usual
  34. printf('Username : %s%sPassword : %s%s WSDL : %s%s%s',
  35. $mailMerge->getUsername(),
  36. PHP_EOL,
  37. $mailMerge->getPassword(),
  38. PHP_EOL,
  39. $mailMerge->getWsdl(),
  40. PHP_EOL,
  41. PHP_EOL
  42. );
  43. unset($mailMerge);