本文整理汇总了PHP中CreateDocx::addDateAndHour方法的典型用法代码示例。如果您正苦于以下问题:PHP CreateDocx::addDateAndHour方法的具体用法?PHP CreateDocx::addDateAndHour怎么用?PHP CreateDocx::addDateAndHour使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreateDocx
的用法示例。
在下文中一共展示了CreateDocx::addDateAndHour方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CreateDocx
<?php
//path to the CreateDocx class within your PHPDocX installation
require_once '../../../classes/CreateDocx.inc';
$docx = new CreateDocx();
//Date in the header
$options_1 = array('bold' => true, 'fontSize' => 12, 'color' => 'b70000', 'dateFormat' => 'dd/MM/yyyy H:mm:ss');
$date = new WordFragment($docx);
$date->addDateAndHour($options_1);
$docx->addHeader(array('default' => $date));
$docx->addText('Let us include now different examples of the addDateAndHour with different date formatting:');
$options_2 = array('textAlign' => 'center', 'bold' => true, 'fontSize' => 14, 'color' => '333333', 'dateFormat' => "dd' of 'MMMM' of 'yyyy' at 'H:mm");
$docx->addDateAndHour($options_2);
$options_3 = array('bold' => true, 'fontSize' => 11, 'color' => '0000FF', 'dateFormat' => "MM'-'dd'-'yy");
$docx->addDateAndHour($options_3);
$docx->createDocx('example_addDateAndHour_1');