Welcome Guest, Not a member yet? Register   Sign In
Get value from array without loop on parased template
#1
Sad 
(This post was last modified: 11-10-2019, 04:29 AM by andru3dward.)

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




Theme © iAndrew 2016 - Forum software by © MyBB