Get skin path in Magento?

后端 未结 6 1399
面向向阳花
面向向阳花 2020-12-14 06:01

I have a few custom PHP functions for my Magento store that I stored in myfunc.php and I need to require it from in a few different .phtml files. How do I do that?

I

6条回答
  •  时光取名叫无心
    2020-12-14 06:12

    The way that Magento themes handle actual url's is as such (in view partials - phtml files):

    echo $this->getSkinUrl('images/logo.png');

    If you need the actual base path on disk to the image directory use:

    echo Mage::getBaseDir('skin');

    Some more base directory types are available in this great blog post:

    http://alanstorm.com/magento_base_directories

提交回复
热议问题