wol-soft/php-micro-template

dotted notation to access variables?

Closed this issue · 4 comments

Hello,

Does it possible to use dotted notation to access variables? It looks that doesn't works for me...

$data = [
  'ticket' => [
     'id' => 14,
     'title' => test
  ]
];
$pattern = ' wo-{{ticket.id}}';
echo $render->renderTemplateString($pattern, $data);

Thank you

Hi @scramatte,

thanks for the feature idea. I've added support for dotted notation to resolve a nested array in version 1.5.0.

Cheers.

Hello, When are you going to release 1.5?
Regards

It's already tagged (https://github.com/wol-soft/php-micro-template/releases/tag/1.5.0).

Just run composer update to fetch the latest version.

Works great thank you very much !