PHP Класс PHPRtfLite_Container_Base

Автор: Steffen Zeidler ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_elements PHPRtfLite_Table_Cell[] | PHPRtfLite_Element[] | PHPRtfLite_Image[] | PHPRtfLite_FormField[]
$_pard string
$_rtf PHPRtfLite

Открытые методы

Метод Описание
__construct ( PHPRtfLite $rtf ) constructor
addElement ( $element ) adds element
addEmptyParagraph ( PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null ) : PHPRtfLite_Element adds empty paragraph to container.
addImage ( string $fileName, PHPRtfLite_ParFormat $parFormat = null, float $width = null, float $height = null ) : PHPRtfLite_Image adds image to element container.
addImageFromString ( string $string, string $type, PHPRtfLite_ParFormat $parFormat = null, float $width = null, float $height = null ) : PHPRtfLite_Image adds image to element container.
addTable ( string $alignment = PHPRtfLite_Table::ALIGN_LEFT ) : PHPRtfLite_Table adds table to element container.
countElements ( ) : integer counts container elements
free ( )
getElements ( ) : array gets container elements
getRtf ( ) : PHPRtfLite gets rtf object
render ( ) : string renders rtf code for that container
writeHyperLink ( string $hyperlink, string $text, PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null, boolean $convertTagsToRtf = true ) : PHPRtfLite_Element writes hyperlink to container.
writePlainRtfCode ( string $code ) : PHPRtfLite_Element adds element with plain rtf code directly (no converting will be made by PHPRtfLite - even no opening and closing curly brackets)
writeRtfCode ( string $code, PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null ) : PHPRtfLite_Element adds element with rtf code directly (no converting will be made by PHPRtfLite)
writeText ( string $text, PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null, boolean $convertTagsToRtf = true ) : PHPRtfLite_Element writes text to container.

Приватные методы

Метод Описание
getCellFont ( PHPRtfLite_Table $element ) : PHPRtfLite_Font gets font if container is a cell
needToAddParagraphEnd ( integer $key ) : boolean checks, if a \par has to be added

Описание методов

__construct() публичный Метод

constructor
public __construct ( PHPRtfLite $rtf )
$rtf PHPRtfLite

addElement() публичный Метод

adds element
public addElement ( $element )
$element

addEmptyParagraph() публичный Метод

adds empty paragraph to container.
public addEmptyParagraph ( PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null ) : PHPRtfLite_Element
$font PHPRtfLite_Font
$parFormat PHPRtfLite_ParFormat
Результат PHPRtfLite_Element

addImage() публичный Метод

adds image to element container.
public addImage ( string $fileName, PHPRtfLite_ParFormat $parFormat = null, float $width = null, float $height = null ) : PHPRtfLite_Image
$fileName string name of image file.
$parFormat PHPRtfLite_ParFormat paragraph format, ff null image will appear in the same paragraph.
$width float if null image is displayed by it's height.
$height float if null image is displayed by it's width. If boths parameters are null, image is displayed as it is.
Результат PHPRtfLite_Image

addImageFromString() публичный Метод

adds image to element container.
public addImageFromString ( string $string, string $type, PHPRtfLite_ParFormat $parFormat = null, float $width = null, float $height = null ) : PHPRtfLite_Image
$string string name of image file.
$type string class constants of PHPRtfLite_Image: TYPE_JPEG, TYPE_PNG, TYPE_WMF
$parFormat PHPRtfLite_ParFormat paragraph format, ff null image will appear in the same paragraph.
$width float if null image is displayed by it's height.
$height float if null image is displayed by it's width. If boths parameters are null, image is displayed as it is.
Результат PHPRtfLite_Image

addTable() публичный Метод

adds table to element container.
public addTable ( string $alignment = PHPRtfLite_Table::ALIGN_LEFT ) : PHPRtfLite_Table
$alignment string Alingment of table. Represented by class constants PHPRtfLite_Table::ALIGN_*
Possible values:
PHPRtfLite_Table::ALIGN_LEFT => 'left',
PHPRtfLite_Table::ALIGN_CENTER => 'center',
PHPRtfLite_Table::ALIGN_RIGHT => 'right'
Результат PHPRtfLite_Table

countElements() публичный Метод

counts container elements
public countElements ( ) : integer
Результат integer

free() публичный Метод

public free ( )

getElements() публичный Метод

gets container elements
public getElements ( ) : array
Результат array

getRtf() публичный Метод

gets rtf object
public getRtf ( ) : PHPRtfLite
Результат PHPRtfLite

render() публичный Метод

renders rtf code for that container
public render ( ) : string
Результат string rtf code

writePlainRtfCode() публичный Метод

adds element with plain rtf code directly (no converting will be made by PHPRtfLite - even no opening and closing curly brackets)
public writePlainRtfCode ( string $code ) : PHPRtfLite_Element
$code string
Результат PHPRtfLite_Element

writeRtfCode() публичный Метод

adds element with rtf code directly (no converting will be made by PHPRtfLite)
public writeRtfCode ( string $code, PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null ) : PHPRtfLite_Element
$code string
$font PHPRtfLite_Font
$parFormat PHPRtfLite_ParFormat
Результат PHPRtfLite_Element

writeText() публичный Метод

writes text to container.
public writeText ( string $text, PHPRtfLite_Font $font = null, PHPRtfLite_ParFormat $parFormat = null, boolean $convertTagsToRtf = true ) : PHPRtfLite_Element
$text string Text. Also you can use html style tags. Possible tags:
strong, b- bold;
em - ;
i - italic;
u - underline;
br - line break;
chdate - current date;
chdpl - current date in long format;
chdpa - current date in abbreviated format;
chtime - current time;
chpgn, pagenum - page number ;
tab - tab sectnum - section number;
line - line break;
page - page break;
sect - section break;
$font PHPRtfLite_Font font of text
$parFormat PHPRtfLite_ParFormat paragraph format, if null, text is written in the same paragraph.
$convertTagsToRtf boolean if false, then html style tags are not replaced with rtf code
Результат PHPRtfLite_Element

Описание свойств

$_elements защищенное свойство

protected PHPRtfLite_Table_Cell[]|PHPRtfLite_Element[]|PHPRtfLite_Image[]|PHPRtfLite_FormField[] $_elements
Результат PHPRtfLite_Table_Cell[] | PHPRtfLite_Element[] | PHPRtfLite_Image[] | PHPRtfLite_FormField[]

$_pard защищенное свойство

protected string $_pard
Результат string

$_rtf защищенное свойство

protected PHPRtfLite $_rtf
Результат PHPRtfLite