|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
jjgitties Smarty n00b
Joined: 23 Apr 2014 Posts: 1
|
Posted: Wed Apr 23, 2014 9:09 pm Post subject: access item from another class within a class |
|
|
Hello, I am trying to achieve the following.
I have a 2 classes.
PersonClass.inc.php
PersonClassDOA.inc.php
GroupClass.inc.php
GroupClassDOA.inc.php
I have a template file which is getting generated from GroupClassDOA. I want to access an object from PersonClassDOA from that tpl file.
For example, in my handler i have will have
$personDao = new &DAORegistry::getDAO('PersonDAO');
I want to pass
$templateMgr->assign('personDao', $personDao);
to the tpl file
and then within the group tpl file access the object like this.
{ $member($personDao->$person->getName()) }
Cant seem to get it to work. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Apr 24, 2014 8:44 am Post subject: |
|
|
What is your variable $member??
Code: | {$personDao->$person->getName()} |
should work from your group tpl. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|