Page::parseText($string[,$method])

Version 3.8

String constructed from page/field values.

Return value

String

Arguments

$string
String to be parsed and replaced with page values.
Value definitions are separated with spaces or braces.
Can be chained: customer.phone
Can call methods: getTitle() field.getValue()
$method
Method name to use when it is not specfied.
default: arvo

Example

{$dateAndAmount = $Order->parseText('order_date total_amount')}

Full documentation

Using plain text -tags in simple content. All tags need to have a space before and after:

$txt = $OrderRow->parseText('product product.group amount.getValue() price');

Complex content

Use brace -tags to use in more complex content:

$html = $OrderRow->parseText('
  <DIV>
    <h4>{product.getTitle()}</h4>
    <p>{product.productgroup}</p>
    <p>{amount.getValue()}pcs {price}</p>
  </DIV>');

Default method

Default method defines, what field type of value is returned from the field. Get join -field id values:

$idValues = $Order->parseText('client,client.seller','value');