Method to convert the string from dash to under_score format
public static dashToUnderscore ( string $string ) : string | ||
$string | string | |
return | string |
public function testString() { $this->assertEquals('hello-world', String::camelCaseToDash('HelloWorld')); $this->assertEquals('hello_world', String::camelCaseToUnderscore('HelloWorld')); $this->assertEquals('helloWorld', String::dashToCamelCase('hello-world')); $this->assertEquals('hello_world', String::dashToUnderscore('hello-world')); }