/ LJCPHPCodeDoc / LJCTextBuilderLib / LJCTextBuilder / Begin


Parameters
$name - The element name.
$textState - The current text state values.
$attribs - The element attributes.
$addIndent - _ParamSummary_
$childIndent - _ParamSummary_

Returns

The added element begin tag.

Syntax

PHP
public function Begin(string $name, LJCTextState $textState
, LJCAttributes $attribs = null, bool $addIndent = true
, bool $childIndent = true): string

Appends the element begin tag.

Remarks

Begin() is an "Append Element" method. It creates the element opening tag with GetCreate() and adds it to the builder. The appended text does not end with a new line. This allows for additions after the text.
The added text will start with a new line if the builder text already has a value.

Example

PHP
 $textState = new LJCTextState();
 $tb = new LJCTextBuilder($textState);
 
 // Example Method:
 $tb->Begin("body", $textState);
 
 $result = $tb->ToString();
 
 // result:
 // <body>

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.