本文整理汇总了PHP中CreateDocx::addTableContents方法的典型用法代码示例。如果您正苦于以下问题:PHP CreateDocx::addTableContents方法的具体用法?PHP CreateDocx::addTableContents怎么用?PHP CreateDocx::addTableContents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreateDocx
的用法示例。
在下文中一共展示了CreateDocx::addTableContents方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CreateDocx
<?php
/**
* Create a DOCX file. Table of contents example
*
* @category Phpdocx
* @package examples
* @subpackage easy
* @copyright Copyright (c) 2009-2011 Narcea Producciones Multimedia S.L.
* (http://www.2mdc.com)
* @license LGPL
* @version 2.0
* @link http://www.phpdocx.com
* @since File available since Release 2.0
*/
require_once '../../classes/CreateDocx.inc';
$objDocx = new CreateDocx();
$objDocx->addTableContents('Arial');
$objDocx->createDocx('example_tablecontents');
示例2: CreateDocx
<?php
//path to the CreateDocx class within your PHPDocX installation
require_once '../../../classes/CreateDocx.inc';
$docx = new CreateDocx();
$docx->addText('Table of Contents', array('bold' => true, 'fontSize' => 14));
$legend = array('text' => 'Click here to update the TOC', 'color' => 'B70000', 'bold' => true, 'fontSize' => 12);
$docx->addTableContents(array('autoUpdate' => true), $legend, '../../files/crazyTOC.docx');
//we add now some headings so tehy show up in the TOC
$docx->addText('Chapter 1', array('pStyle' => 'Heading1PHPDOCX'));
$docx->addText('Section', array('pStyle' => 'Heading2PHPDOCX'));
$docx->addText('Another TOC entry', array('pStyle' => 'Heading3PHPDOCX'));
$docx->createDocx('example_addTableContents_1');