When i do this:
$array = array(
'test' => array(
'key1' => 'value1'
)
);
$modx->setPlaceholders($array);
If returns the placeholder as:
It used to be:
Is this a feature? Or a bug? Am i missing something?
-
☆ A M B ☆
- 1,056 Posts
Quote from: splittingred at Dec 09, 2010, 07:46 AM
Use $modx->toPlaceholders:
$modx->toPlaceholders(array(
'test' => array(
'key1' => 'value1',
),
));
setPlaceholders doesn’t use the separator. From the method definition documentation of setPlaceholders:
* Note that unlike toPlaceholders(), this function does not add separators between the
* namespace and the placeholder key. Use toPlaceholders() when working with multi-dimensional
* arrays or objects with variables other than scalars so each level gets delimited by a
* separator.
Awesome, good to know! Having multi-dimensional support in the core is an excellent feature when using namespaced data sets.