Using code hints in Magento e-Commerce templates…

When you’re using a complex web application like Magento or WordPress it’s a real struggle to remember all the functions, classes and methods that are available to you in the template files. And this means endless trips back to the documentation, trial and error, and other such in-efficiences.

Fortunately you can speed things up a load by manually adding code hints for a variable, which then should bring up code completion hints in any half decent IDE like Eclipse or Netbeans.


<?php
/* @var $_product Mage_Catalog_Model_Product */
echo $_product->getData('short_description');
?>

Of course if it’s a complex object you can end up with an enormous list of methods, then you just have to pray that someone has included decent phpdoc in the Class definition (Magento doesn’t, WordPress does).

Need some help with an e-Commerce solution? Small business looking for inexpensive e-Commerce, or design agency looking for talented freelancer in and around Bath, Bristol, Wiltshire or Somerset? Why not get in touch?

This entry was posted in Web Development and tagged , , . Bookmark the permalink.

Comments

Awwww. No one's left a comment yet. Why don't you start things off?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get Email Alerts

Signup to receive occasional emails with news that may be of interest. Your details will never be disclosed to 3rd parties.




* = required field
I'm interested in...