Skip to content

Commit c312212

Browse files
authored
Escaped type string
1 parent 659870c commit c312212

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

code/DataObjects/Module.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ public function Type(){
4141
return $this->singular_name();
4242
}
4343

44+
/**
45+
* Convert our type into an escaped string for construcing classes
46+
* @return string
47+
**/
48+
public function TypeEscaped(){
49+
$type = $this->Type();
50+
$type = str_replace(' ','_',$type);
51+
$type = strtolower($type);
52+
return $type;
53+
}
54+
4455
/**
4556
* Identify this page component type
4657
* Used in GridField for type identification

0 commit comments

Comments
 (0)