-
-
Save kinglozzer/bf49a1f754ccc3ca9d6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class CMSMainExtension extends Extension { | |
/** | |
* @var array | |
*/ | |
private static $allowed_actions = array( | |
'cloneAction' | |
); | |
public function cloneAction(array $data, Form $form) { | |
$record = DataObject::get_by_id("SiteTree", $data['ID']); | |
// Do clone stuff | |
return $this->owner->getResponseNegotiator()->respond($this->owner->request); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CMSMain: | |
extensions: | |
- CMSMainExtension |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment