Skip to main content

How to make Renderer in custom module magento

1)managedesign is my custom module
2) /app/code/local/Managedesign/Managedesign/Block/Adminhtml/Managedesign/Grid.php

    call rander method:
    "design_id" ia a database attribut;
    
        $this->addColumn("design_id", array(
            "header" => Mage::helper("managedesign")->__("Link"),
            "index" => "design_id",
            'renderer'  => 'managedesign/adminhtml_managedesign_renderer_image'

                ));
                
3)crerate a folder Renderer and make a file Image.php
    /app/code/local/Managedesign/Managedesign/Block/Adminhtml/Managedesign/Renderer/Image.php
    
    
    class Managedesign_Managedesign_Block_Adminhtml_Managedesign_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract{
     
    public function render(Varien_Object $row)
    {
        $html = '<img width="105" height="15" ';
        $html .= 'id="' . $this->getColumn()->getId() . '" ';
        $html .= 'src="' . Mage::getBaseUrl('web').'customizer/designs/'.$row->getData($this->getColumn()->getIndex()) . '_FRONT.png"';
        $html .= 'class="grid-image ' . $this->getColumn()->getInlineCss() . '"/>';
       $html .= '<br/><p><a href="'.$row->getData($this->getColumn()->getIndex()).'">Downlode Design</a></p>';
        return $html;
    }
}

Comments

Popular posts from this blog

Parsing Domain Name From URL In PHP

To get Domain name from the url, we can use parse_url() php function. This would filter the domain name from the given url. $domain = str_ireplace ( 'www.' , '' , parse_url ( $url , PHP_URL_HOST )); This would return the google.com for both http://google.com and http://www.google.com

Is covid virus really airborne?

  If airborne transmission is a significant factor in the pandemic, especially in crowded spaces with poor ventilation, the consequences for containment will be significant. How did the experts reach this conclusion? Reviewing existing research, the six experts from the UK, US and Canada identified 10 streams of evidence that collectively support the hypothesis that SARS-CoV-2 primarily transmits through the airborne route. 1. Super-spreading events account for substantial SARS-CoV-2 transmission. Indeed, the authors wrote, such events may be the  pandemic ’s primary drivers. Detailed analyses of human behaviours and other variables in concerts, cruise ships etc have shown patterns “consistent with airborne spread of SARS-CoV-2 that cannot be adequately explained by droplets or fomites”, they wrote. 2. Long-range transmission of SARS-CoV-2 between people in adjacent rooms has been documented in quarantine hotels, but never in each other’s presence. 3. Asymptomatic or pre-sympt...