class
Making use of Magento getSingleton method
12 Comments 9th OCT 2008 | Posted by Branko Ajzele in Magento

In one of my previous articles I showed you how to use getModel and getData methods in Magento. Although we should not put those to methods at the same level, since I’d say the getModel is a bit more higher. Higher in sense, you first use the geModel to create the instance of object then you use getData to retrieve the data from that instance. I have said it before, and I’m saying it again; Magento is a great peace of full OOP power of PHP. It’s architecture is something not yet widely seen in CMS solutions.
One of the architectural goodies of Magento is it’s Singleton design pattern. In short, Singleton design pattern ensures a class has only one instance. Therefore one should provide a global point of access to that single instance of a class.
Read more...Figuring out Magento object context
5 Comments 10th SEP 2008 | Posted by Branko Ajzele in Magento, Tools

One of the problems working under the hood of the Magento CMS is determining the context of $this. If you are about to do any advanced stuff with your template, besides layout changes, you need to get familiar with Magento’s objects (classes).
Let’s have a look at the /app/design/frontend/default/default/template/catalog/product/view.phtml file. If you open this file and execute var_dump($this) your browser will return empty page after a short period of delay. By page I mean on the product view page; the one you see when you click on Magetno product. Experienced users will open PHP error log and notice the error message caused by var_dump().
Read more...- New Comments
- Weekly Populars
- Tag cloud
- Toni Anicic on Explaining the Sitemap SEO Myth:
Uwe, Very interesting, I didn't notice this issue with Magento's sitemaps till you pointed it out... - Uwe Stoll on Explaining the Sitemap SEO Myth:
Hi, working in the field of semantic web, we have developed an extension for Magento to publish o... - Nirmik on Featured products Magento extension by Inchoo:
It’s very nice module, it’s easy to install and use.... - Mladen Lotar on Basic folder structure for new Magento module:
@Ivan - thanks for the link, but check out the dates :D @Brady - thanks... - Sudhansu Ranjan Mangaraj on How to create Magento payment module:
this is really helpfull. Some times Before I was created a payment but for some reason when i create... - mike m on How to use WordPress home page in Magento home page (CMS page):
Could someone possibly expand on: 1) How to add the entire pages content less header and footer rat... - Brady on Basic folder structure for new Magento module:
Thanks for the article Mladen. That's very helpful!... - Raul E Watson on Internal Server Error 500 in Magento:
I think this is more related to the php5.ini file and the .htaccess file rather than a file being co... - NS on Internal Server Error 500 in Magento:
I had edited an item in System> Configuration> Web> as I was in the process of adding a new... - Toni Anicic on Explaining the Sitemap SEO Myth:
@Alan, I believe they still support this sitemap XML program in Google Webmaster Tools because a ...

