Advertisement
Guest User

Untitled

a guest
Oct 18th, 2012
841
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.86 KB | None | 0 0
  1. <?php
  2. class Something
  3.     extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
  4. {
  5.     public function render(Varien_Object $row)
  6.     {
  7.         $column_data = $row->getData(
  8.             $this->getColumn()->getIndex()
  9.         );
  10.  
  11.         return $this->getLayout()
  12.             ->createBlock('something/adminhtml_renderer_link')
  13.                 ->setLink($column_data )
  14.                     ->_toHtml();
  15.     }
  16. }
  17. ?>
  18.  
  19. <?php
  20. class Something
  21.     extends Mage_Core_Block_Template
  22. {
  23.     protected function _construct()
  24.     {
  25.         parent::_construct();
  26.         $this->setTemplate('something/link.phtml');
  27.     }
  28. }
  29. ?>
  30.  
  31. <?php
  32. $link = $this->getLink();
  33. ?>
  34. <?php if ($link): ?>
  35. <a href="<?php echo $link ?>" target="_blank"><?php echo $this->__('Click to view!'); ?></a>
  36. <?php else: ?>
  37.     <?php echo $this->__('No link'); ?>
  38. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement