Last active
November 13, 2015 19:21
-
-
Save herveguetin/22659d6b7883a9127b91 to your computer and use it in GitHub Desktop.
Transform any string to url-like string in Magento (useful for dynamic CSS classes for example)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$string = 'My String'; | |
$urlKeyString = Mage::getSingleton('catalog/product')->formatUrlKey($string); | |
// Returns => my-string | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment