Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

access item from another class within a class

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
jjgitties
Smarty n00b


Joined: 23 Apr 2014
Posts: 1

PostPosted: Wed Apr 23, 2014 9:09 pm    Post subject: access item from another class within a class Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu Apr 24, 2014 8:44 am    Post subject: Reply with quote

What is your variable $member??

Code:
{$personDao->$person->getName()}

should work from your group tpl.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP