codecompleting
codecompleting

Reputation: 9621

What does $this refer to in magento's actions?

I'm looking at this file:

https://github.com/magentomirror/magento-mirror/blob/magento-1.5/app/code/core/Mage/Catalog/controllers/ProductController.php

what does:

$this

and

$this->

refer to?

Upvotes: 2

Views: 1359

Answers (1)

piddl0r
piddl0r

Reputation: 2449

It refers to the object "Mage_Catalog_ProductController" in that case. "$this" refers to the current object, so it's relative to which class it's called from.

PHP Manual for OOP

Upvotes: 6

Related Questions