Categories
Magento 2

Magento 2: Disable All Modules By Vendor (Regex)

Use this find/replace regex in config.php to set all modules by a particular vendor to disabled.

Find Tab

(Amasty_[a-z0-9_]+'\s?=>\s?)(1)

Replace Tab

$10
Categories
Uncategorised

PHP Regex Snippet: Convert a Title to a Code

This will take out any non-alphanumeric characters and replace them with an underscore

    protected function convertTitleToCode($title)
    {
        return preg_replace("/[^\w]/i", "_", trim(strtolower($title)));
    }