Skip to content

Class \avadim\FastExcelWriter\RichText\RichText



__construct()


public function __construct($fragments)
RichText constructor

Parameters

  • string|array|null $fragments

__toString()


public function __toString(): string

Parameters

None


addTaggedText()


public function addTaggedText(string $text): RichText
Add tagged text (, , , , , )

Parameters

  • string $text

addText()


public function addText(string $text, $prop): RichText
Add a text fragment

Parameters

  • string $text
  • mixed $prop

fragment()


public function fragment($num): RichTextFragment
Get fragment by its index

Parameters

  • $num

fragments()


public function fragments(): array
Get all fragments

Parameters

None


setBold()


public function setBold(): RichText
Set bold font for the last added fragment

Parameters

None


setColor()


public function setColor(string $color): RichText
Set font color for the last added fragment

Parameters

  • string $color

setFont()


public function setFont(string $font): RichText
Set font name for the last added fragment

Parameters

  • string $font

setItalic()


public function setItalic(): RichText
Set italic font for the last added fragment

Parameters

None


setSize()


public function setSize(int $size): RichText
Set font size for the last added fragment

Parameters

  • int $size

setUnderline()


public function setUnderline(?bool $double = false): RichText
Set underline for the last added fragment

Parameters

  • bool|null $double