Creating Elements¶
to create your own element all you need to do is extend your element (MyElement) with the core class (Element)
<?php
class MyElement extends Element {
}
By default Elements are rendered with ClassName - template (IE MyElement.ss)
this behavior can be changed by overwriting Element::forTemplate()
Eg:
function forTemplate() {
return "Hello World";
}
You can add custom cms edit fields by overloading Element::getCMSFields() (same as Page::getCMSFields())