function ds_prepare_machine_name in Display Suite 8.2
Same name and namespace in other branches
- 8.3 drush/ds.drush.inc \ds_prepare_machine_name()
- 7.2 drush/ds.drush.inc \ds_prepare_machine_name()
- 7 ds.drush.inc \ds_prepare_machine_name()
Prepare a string for use as a valid machine name.
4 calls to ds_prepare_machine_name()
- drush_ds_build in drush/
ds.drush.inc - Create a basic template and configuration file for a Display Suite layout.
- ds_prepare_regions_configuration in drush/
ds.drush.inc - Prepare configuration for an array of regions.
- ds_prepare_regions_html in drush/
ds.drush.inc - Prepare HTML structure for an array of regions.
- ds_prepare_regions_variable_documentation in drush/
ds.drush.inc - Prepare variable documentation for an array of regions.
File
- drush/
ds.drush.inc, line 146 - Display Suite drush integration.
Code
function ds_prepare_machine_name($string) {
$machine_name = str_replace(' ', '_', Unicode::strtolower($string));
// Remove characters not valid in function names.
$machine_name = preg_replace('/[^a-z0-9_]/', '', $machine_name);
return $machine_name;
}