I want to know with a pretty explanation the difference between the different types of Observers bellow:
1)
<?php
class Company_Module_Model_Observer
{
public function someFunction($observer)
{
...
}
}
2)
<?php
class Company_Module_Model_Observer extends Varien_Event_Observer
{
public function someFunction($observer)
{
...
}
}
3)
<?php
class Company_Module_Model_Observer
{
public function someFunction(Varien_Event_Observer $observer)
{
...
}
}
And also the difference in the xml declaration between <type>singleton</type> and <type>model</type>, in which case we should use each one.
class Company_Module_Model_Observer extends Mage_Core_Model_Observerit is not necessary right ? – PЯINCƎ Sep 18 '17 at 21:42<type>model</type>for the reasons you explained to me, and if I use all the timemodel, this is a good practice, at least I avoid danger ? – PЯINCƎ Sep 18 '17 at 21:54core_block_abstract_to_html_beforeought to be observed by a single instance if possible. – Rick Buczynski Sep 18 '17 at 22:57