Hello here some useful code for Magento developer
{{base url=''}}
{{store url='test. html'}} also only store url
{{store url=""}}
{skin url='images/imagename.jpg'}}
1) Get Base Url in magento :
$baseurl = Mage:: getBaseUrl ( );
2) Current Url
$currentUrl = Mage:: helper( 'core/url') ->getCurrentUrl ( );
$currentUrl = Mage:: getUrl ( '*/*/*', array( '_current' => true));
if (!in_array(Mage::app()->getFrontController()->getAction()->getFullActionName(), array('cms_index_noRoute', 'cms_index_defaultNoRoute')))
{
$currentUrl = Mage:: helper( 'core/url') ->getCurrentUrl ( );
}
$skinUrl = Mage:: getBaseUrl ( Mage_Core_Model_Store:: URL_TYPE_SKIN);
Unsecure Skin Url :
$skinUrl = $this->getSkinUrl ( 'images/imagename.jpg');
Secure Skin Url :
$this->getSkinUrl ( 'images/imagename.gif', array( '_secure'=>true));
$mediaUrl = Mage:: getBaseUrl ( Mage_Core_Model_Store:: URL_TYPE_MEDIA);
$mediaUrl = Mage:: getBaseUrl ( 'media');
$jsUrl = Mage:: getBaseUrl ( Mage_Core_Model_Store:: URL_TYPE_JS);
$jsUrl = Mage:: getBaseUrl ( 'js ');
$storeUrl = Mage:: getBaseUrl ( Mage_Core_Model_Store:: URL_TYPE_WEB);
$homeUrl= Mage:: helper( 'core/url') ->getHomeUrl ( );
0 komentar:
Post a Comment