2

what is the equivalent class of Mage_Core_Block_Text_Tag_Js in magento2?

class Mage_Core_Block_Text_Tag_Js extends Mage_Core_Block_Text_Tag
{

    protected function _construct()
    {
        parent::_construct();
        $this->setTagName('script');
        $this->setTagParams(array('language'=>'javascript', 'type'=>'text/javascript'));
    }

    function setSrc($src, $type=null)
    {
        $type = (string)$type;
        if (empty($type)) {
            $type = 'js';
        }
        $url = Mage::getBaseUrl($type).$src;

        return $this->setTagParam('src', $url);
    }

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.