Created
September 26, 2018 15:44
-
-
Save mainframe98/376479136055c4c94a5d2453e640cc76 to your computer and use it in GitHub Desktop.
A special page showcasing OOUI HTMLFormFieldCloner. Use in conjunction with https://gerrit.wikimedia.org/r/c/mediawiki/core/+/421373
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 SpecialTest extends FormSpecialPage { | |
public function __construct() { | |
parent::__construct( 'Test', '', false ); | |
} | |
protected function getFormFields() : array { | |
return [ | |
'clone' => [ | |
'type' => 'cloner', | |
'label' => 'cloner', | |
'help' => 'Some Help Text', | |
'fields' => [ | |
'title' => [ | |
'type' => 'int', | |
'help' => 'Some Help Text' | |
] | |
], | |
'default' => [ | |
[ 'title' => 5 ], | |
[ 'title' => 7 ] | |
] | |
] | |
]; | |
} | |
public function onSubmit( array $data ) { | |
wfVarDump( $data ); | |
return true; | |
} | |
protected function getDisplayFormat() { | |
$useooui = $this->getRequest()->getBool( 'useooui', true ); | |
return $useooui ? 'ooui' : 'table'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment