I have an issue with passing an object to smarty tag. I have the following code:
$contact = new Contacts;
$smarty = new Smarty;
$smarty->assign('contact',$contact);
In test.htpl :
<html>
<head>
<title>{$title}</title>
</head>
<body>
id: {$contact->id} <br/>
name: {$contact->name} <br/>
email: {$contact->email} <br/>
phone: {$contact->phone} <br/>
</body>
</html>
this leads to an warning of invalid character '>'. How can I solve this?
I used this class for testing:
class Contacts
{
public $id = 1;
public $name = 'Mada';
public $email = '[email protected]';
public $phone = 123456;
}