• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get value from array without loop on parased template

#1
Sad 
Hello, 
i need to get value from array in a parased template, so in my case:
  • I made a template system where all templates end in .tpl
  • second, i need to get an value from a array like that 
Code:
{member.name}
 or 
Code:
{$member.name}

 without usinge metod like 


Code:
{member}
    {name}
{/member}
Like Smarty template Engine do

This is my code:

Code:
$data = [
      'member'      => $member->memberInfo(),  // Array from DB if the member is logged otherwise it is false
      'content'   => $this->body
];

print $parser->setData( $data, 'raw' )->render( $layout );


I was not able to find it in the documentation or in the code and I need this in templates

I hope you get it cuz in this moment i can't exprime myself   Dodgy
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.