forked from GNUsocial/gnu-social
[Poll] Added variable num of options
not sure if it is the right way to do it
This commit is contained in:
@@ -30,6 +30,13 @@ use Symfony\Component\Form\Form as SymfForm;
|
||||
const MAX_OPT = 5;
|
||||
class NewPollForm extends Form
|
||||
{
|
||||
/**
|
||||
* Creates a form with variable num of fields
|
||||
*
|
||||
* @param int $optionNum
|
||||
*
|
||||
* @return SymfForm
|
||||
*/
|
||||
public static function make(int $optionNum): SymfForm
|
||||
{
|
||||
$optionNum = min(MAX_OPT,$optionNum);
|
||||
|
@@ -29,6 +29,13 @@ use Symfony\Component\Form\Form as SymfForm;
|
||||
|
||||
class PollResponseForm extends Form
|
||||
{
|
||||
/**
|
||||
* Creates a radio form with the options given
|
||||
*
|
||||
* @param array $opts options
|
||||
*
|
||||
* @return SymfForm
|
||||
*/
|
||||
public static function make(array $opts): SymfForm
|
||||
{
|
||||
$formOptions = [];
|
||||
|
Reference in New Issue
Block a user