CodeIgniter Forums

Full Version: Dan's SimpleTags: Keyed data-array not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Hi guys,

In the readme of Dan Horrigan's SimpleTags library it is mentioned that data from the data-array can be fetched as such: {foo:bar} .. However in my tests I wasn't able to achieve this behaviour.

Consider the following code:

$data['foo']['bar'] = 'Test value 1';
$data['foobar'] = 'Test value 2';

$content = '{foo:bar} {foobar}';

$parsed = $this->tags->parse($content, $data);

This produces "{foo:bar} Test value 2", in other words, the first tag {foo:bar} is not being parsed correctly. I wasn't able to debug everything entirely, but I did found that the function '_parse_data_single', which is supposed to take care of these kind of tags, is never called.

Is it a bug? Or am I doing something wrong? Any help is greatly appreciated!


El Forum

[eluser]Mr. Pickle[/eluser]
I've never used this library but I think the set_trigger function wants you to set the trigger.
So it will probably be:


Again, this is a quick reply I don't have the time yet to test it.