template-exists.php 643 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. require_once dirname(__FILE__) . '/../../common.php';
  3. system('clear');
  4. print(Demos_Zend_Service_LiveDocx_Helper::wrapLine(
  5. PHP_EOL . 'Checking For Remotely Stored Templates' .
  6. PHP_EOL .
  7. PHP_EOL)
  8. );
  9. $mailMerge = new Zend_Service_LiveDocx_MailMerge();
  10. $mailMerge->setUsername(DEMOS_ZEND_SERVICE_LIVEDOCX_USERNAME)
  11. ->setPassword(DEMOS_ZEND_SERVICE_LIVEDOCX_PASSWORD);
  12. print('Checking whether a template is available... ');
  13. if (true === $mailMerge->templateExists('template-1.docx')) {
  14. print('EXISTS. ');
  15. } else {
  16. print('DOES NOT EXIST. ');
  17. }
  18. print('DONE' . PHP_EOL);
  19. print(PHP_EOL);
  20. unset($mailMerge);