Magento Tip: Template and modules debug functions

Some helpful snippets of code to use when debugging magento templates in development:

  var_export(get_class_methods(get_class($classname)));

  var_export(array_keys( $this->getData() )); //or

  var_export(array_keys( $object->getData() ));

  var_export($object->debug());

 

When using with Mage::log() for modules in community or local code pools.

  Mage::log(var_export(get_class_methods(get_class($classname)), TRUE),NULL,’some_filename.log’);

  Mage::log(var_export(array_keys( $this->getData() ), TRUE),NULL,’some_filename.log’); //or

  Mage::log(var_export(array_keys( $object->getData() ), TRUE),NULL,’some_filename.log’);

  Mage::log(var_export($object->debug(), TRUE));

Anuncis

Etiquetes: , ,

Deixa un comentari

Fill in your details below or click an icon to log in:

WordPress.com Logo

Esteu comentant fent servir el compte WordPress.com. Log Out / Canvia )

Twitter picture

Esteu comentant fent servir el compte Twitter. Log Out / Canvia )

Facebook photo

Esteu comentant fent servir el compte Facebook. Log Out / Canvia )

Google+ photo

Esteu comentant fent servir el compte Google+. Log Out / Canvia )

Connecting to %s


%d bloggers like this: