modX.toPlaceholders

Skip to end of metadata
Go to start of metadata


modX::toPlaceholders

Sets placeholders from values stored in arrays and objects.

Each recursive level adds to the prefix, building an access path using an optional separator.

Syntax

API Doc: http://api.modxcms.com/modx/modX.html#toPlaceholders

void toPlaceholders (array|object  $subject, [string $prefix = ''], [string $separator = '.'])

Example

Set an array of placeholders and prefix with 'my.'

$modx->toPlaceholders(array(
  'name' => 'John',
  'email' => 'jdoe@gmail.com',
),'my');

See Also

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.