create
[ class tree: create ] [ index: create ] [ all elements ]

example

  1. <?php
  2.  
  3. /**
  4.  * Inserts a coment in the middle of a run of text.
  5.  *
  6.  * @category   Phpdocx
  7.  * @package    examples
  8.  * @subpackage easy
  9.  * @copyright  Copyright (c) 2009-2013 Narcea Producciones Multimedia S.L.
  10.  *              (http://www.2mdc.com)
  11.  * @license    http://www.phpdocx.com/wp-content/themes/lightword/pro_license.php
  12.  * @version    2013.08.26
  13.  * @link       http://www.phpdocx.com
  14.  * @since      2013.08.26
  15.  */
  16.  
  17. require_once '../../classes/CreateDocx.inc';
  18.  
  19. $docx new CreateDocx();
  20.  
  21. $commentData $docx->addComment(
  22.     array(
  23.         'textDocument' => 'comment',
  24.         'textComment' => 'The comment we want to insert.',
  25.         'initials' => 'PT',
  26.         'author' => 'PHPDocX Team',
  27.         'date' => '10 September 2000',
  28.         'rawWordML' => true,
  29.     )
  30. );
  31.  
  32. $commentFragment $docx->createWordMLFragment($commentData);
  33.  
  34.  
  35. $text array();
  36. $text[]array('text' => 'Here comes the ');
  37. $text[]$commentFragment;
  38. $text[]array('text' => ' and some other text.');
  39.  
  40. $paragraphOptions array('i' => 'on');
  41.  
  42. $docx->addText($text$paragraphOptions);
  43.  
  44.  
  45. $docx->createDocx('../docx/example_comment');

Documentation generated on Mon, 13 Jan 2014 13:44:05 +0100 by phpDocumentor 1.4.4