Permalink
Browse files

API Machine-friendly name for CMS states navigator (stages).

Used programmatically by the side-by-side state switcher.
  • Loading branch information...
1 parent aaae8c9 commit 47f41d80c6e6f2e278d970c7b006deaad9e9daa3 @mateusz mateusz committed with chillu Nov 29, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 code/controllers/SilverStripeNavigator.php
@@ -126,6 +126,13 @@ public function getHTML() {}
*/
public function getTitle() {}
+ /**
+ * Machine-friendly name.
+ */
+ public function getName() {
+ return substr(get_class($this), strpos(get_class($this), '_')+1);
+ }
+
/**
* Optional link to a specific view of this record.
* Not all items are simple links, please use {@link getHTML()}

0 comments on commit 47f41d8

Please sign in to comment.