I need to display {$user.unread} in this format in my *.tpl file without any for loop so that only the number 3 shows up.
my php files has $user = array('unread' => 3); what should my smarty assign and php array codes be?
I’m doing this to integrate design with smarty codes, without the need to connect up with the database. Hence, {$user.unread} has to be the format to call “3” or any number in the *.tpl file, but in the php file I can define a static array and call the smarty accordingly. I’m unsure of the syntax in the php file to define this static array and define the smarty assign.
You could just assign the array to the smarty variable. It should work the way you intended.
in php:
in tpl: