Magento,仅在特定块中隐藏工具栏

I'm trying to hide the toolbar of the products only in the block footer but without success. I have tried using the function

<?php if(Mage::app()->getLayout()->getBlockName () != "footer"): ?>

but it returned an error. I do not want me to hide the toolbar across the page, but only in a specific block. How can I hide the toolbar in a specific block?

Thanks for any help.

You can remove block using chenging layout xml,add like as below in your local.xml file

  <reference name="footer">
    <remove name="block name" /> 
 </reference>

This URL have more details about local.xml http://magebase.com/magento-tutorials/5-useful-tricks-for-your-magento-local-xml/

Although I would suggest doing most of those kind of task in the layout, as Shijin is proposing it. If you tried it that way and for some reason cannot do it properly in the layout, you can use the method getNameInLayout available for any block extending Mage_Core_Block_Abstract

<?php if($this->getNameInLayout() != "footer"): ?>