class thingys

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

class thingys

Post by shiznatix »

ok im starting on this project and the documentation has this kinda stuff

Code: Select all

$this->tmpl->exec('et_media.et_media.edit',$content);
now my question is in the $this->name->other...what does the 2 arrow things mean? i never saw that before.
User avatar
Maugrim_The_Reaper
DevNet Master
Posts: 2704
Joined: Tue Nov 02, 2004 5:43 am
Location: Ireland

Post by Maugrim_The_Reaper »

It means $tmpl is itself an object which is set as a property of the current ($this) object.

Kindof like having:

Code: Select all

class Template (

    function assign() {
        ...
    }

)

class AppHelper (

    var $tpl;

    function AppHelper($tpl) {
        $this->tpl = $tpl;
    }
)

$app = new AppHelper( new Template() );
$app->tpl->assign('value', 'property');
Post Reply