How can I hook on scripts and CSS into <head>?

前端 未结 3 1810
迷失自我
迷失自我 2021-01-01 02:37

The thing with the module I am making is that it kind of generates a javascript snippet, so I cannot use an action to just hook that into the section of the HTML since the

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-01 02:47

    Ok this is an embarrassing hack BUT as Alan Storm pointed out this will not work in adminhtml so, in the spirit of trying to keep my code/files to a minimum, I've hacked up magento and this is working for me lol

    $layout = Mage::app()->getLayout();
    $headBlock = $layout->getBlock('head');
    
    $headBlock->addLinkRel('blank', '" />
        
        
    
                                                            
提交回复
热议问题