Try the Demo

Magento Forum

   
Phtml files: “this” keyword
 
BoostMyShop
Sr. Member
 
Avatar
Total Posts:  151
Joined:  2008-06-11
France
 

Hello smile

i’m working with phtml files: ok.
However, i dont know to what refers this keyword.

I suspect that it refers to the class name set through the type attribute of block markups…

thanks smile

Olixelle

 Signature 

________________________________________________
Find out our extensions :
Magento Embedded ERP: a set of extension to embeded an ERP within Magento !
Magento Customer Quote: send custom quote to your customer or enable quote request from you website !

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brandlive (Brasil)
Guru
 
Avatar
Total Posts:  653
Joined:  2008-05-19
Buenos Aires, Argentina
 

$this is the object instance that you’re using.

If you want more php documentation about objects and classes, you can read http://ar2.php.net/manual/en/language.oop5.php.

 Signature 

Brandlive eCommerce
| brandlivecommerce.com/magento

 
Magento Community Magento Community
Magento Community
Magento Community
 
BoostMyShop
Sr. Member
 
Avatar
Total Posts:  151
Joined:  2008-06-11
France
 
Barbanet - 13 June 2008 07:36 AM

$this is the object instance that you’re using.

If you want more php documentation about objects and classes, you can read http://ar2.php.net/manual/en/language.oop5.php.

hello barbanet

i know what is this object and oop concepts
i’m just trying to know to what object or class is refering this depending of the phtml file

thanls

 Signature 

________________________________________________
Find out our extensions :
Magento Embedded ERP: a set of extension to embeded an ERP within Magento !
Magento Customer Quote: send custom quote to your customer or enable quote request from you website !

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brandlive (Brasil)
Guru
 
Avatar
Total Posts:  653
Joined:  2008-05-19
Buenos Aires, Argentina
 

Sorry, I misunderstood your post.
Well, you can try with

<?php

class foo {
    
function name()
    
{
        
echo "My name is " get_class($this) , "\n";
    
}
}

// create an object
$bar = new foo();

// external call
echo "Its name is " get_class($bar) , "\n";

// internal call
$bar->name();

?>

More class functions at: http://ar2.php.net/manual/en/function.get-class.php

If this can’t help you, I’m gonna think that it’s too much english for me on friday.
wink

 Signature 

Brandlive eCommerce
| brandlivecommerce.com/magento

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top