PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

Creating a first text document | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

Creating a first text document

Creating an OpenDocument text document is really simple.

<?php
/**
* This script demonstrates how to create a new text document by
* adding a headline and a paragraph containing a link.
*/
require_once 'OpenDocument.php';

$doc = new OpenDocument();
$doc->createHeading('Welcome to OpenDocument!'1);
$p $doc->createParagraph('This script serves as a demonstration of PEAR\'s
OpenDocument package. You are invited to explore the capabilities of this
package and to read the API documentation available at '
);
$p->createHyperlink('pear.php.net''http://pear.php.net/package/OpenDocument');
$p->createTextElement('. Have fun!');

$doc->save('my-first-document.odt');
?>

After creating an OpenDocument instance, there are several methods available to create actual content; all of them are prefixed with create.

All of those methods return the created object. This object has already been inserted at the end of the document.

The newly created element may have some create*() methods of its own - a paragraph for example allows you to add links and additional text elements.

When you are done, call OpenDocument::save() with the filename as only parameter to store the document on disk.

Until version 0.1.2, only relative filenames are allowed.

忘却曲線を使ってこの知識を確実に記憶に残す

フォーラムで「Creating a first text document」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | Creating a first text document」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: