Closed (fixed)
Project:
Token
Version:
5.x-1.7
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Jul 2007 at 15:56 UTC
Updated:
9 Aug 2007 at 23:18 UTC
Maybe I'm misinterpreting things, but there is a portion of the API.txt file that is confusing.
The section labeled "Altering the Replacement Values", last line of the last paragraph, says
"The return value will be an array with tokens as keys to their own replacement values."
When I first read this, I expected something like...
array(
token1 => value1,
token2 => value2,
etc.
);Instead, the array (or more accurately, object) looks like...
stdClass Object {
[tokens] => array(
[0] => mytoken1,
[1] => mytoken2
),
[values] => array(
[0] => value1,
[1] => value2,
)
}Perhaps the simplest way to handle this would be to add an example to the documentation.
Comments
Comment #1
gregglesQuite confusing indeed! Thanks for noticing, submitting an issue, and providing an idea for how to fix it.
I do wonder if we should be returning an object or an array of arrays, though that's a question for a different issue.
Fixed - new text below.
"The return value will be an object containing one array of tokens
and one array of values as in this example:
stdClass Object {
[tokens] => array(
[0] => mytoken1,
[1] => mytoken2
),
[values] => array(
[0] => value1,
[1] => value2,
)
}"
Comment #2
(not verified) commented