开发者

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

开发者 https://www.devze.com 2023-03-25 17:32 出处:网络
I\'m looking at this file: https://github.com/magentomirror/magento-mirror/blob/开发者_运维技巧magento-1.5/app/code/core/Mage/Catalog/controllers/ProductController.php

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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消