public function build(ConfigInterface $config, $width, ManialinkInterface $manialink, ManialinkFactory $manialinkFactory): Renderable
    {
        $input = $this
            ->uiFactory
            ->createInput($config->getPath(), '')
            ->setWidth($width * 0.66);
        $addButton = $this->uiFactory
            ->createButton('Add')
            ->setWidth($width * 0.33)
            ->setAction(
                $this->actionFactory->createManialinkAction(
                    $manialink,
                    function (ManialinkInterface $manialink, $login, $entries, $args) use ($manialinkFactory) {
                        /** @var TextListConfig $config */
                        $config = $args['config'];

                        if (!empty($entries[$config->getPath()])) {
                            $config->add(trim($entries[$config->getPath()]));

                            $manialinkFactory->update($manialink->getUserGroup());
                        }
                    },
                    ['config' => $config]
                )
            );

        $elements = [$this->uiFactory->createLayoutLine(0,0, [$input, $addButton])];
        foreach ($config->get() as $element) {
            $elements[] = $this->getElementLine($config, $manialink, $element, $width, $manialinkFactory);
        }

        return $this->uiFactory->createLayoutRow(0, 0, $elements, 0.5);
    }
public function build(ConfigInterface $config, $width, ManialinkInterface $manialink, ManialinkFactory $manialinkFactory): Renderable
    {
        $input = $this
            ->uiFactory
            ->createInput($config->getPath(), '')
            ->setWidth($width * 0.66);
        $addButton = $this->uiFactory
            ->createButton('Add')
            ->setWidth($width * 0.33)
            ->setAction(
                $this->actionFactory->createManialinkAction(
                    $manialink,
                    function (ManialinkInterface $manialink, $login, $entries, $args) use ($manialinkFactory) {
                        /** @var TextListConfig $config */
                        $config = $args['config'];

                        if (!empty($entries[$config->getPath()])) {
                            $config->add(trim($entries[$config->getPath()]));

                            $manialinkFactory->update($manialink->getUserGroup());
                        }
                    },
                    ['config' => $config]
                )
            );

        $elements = [$this->uiFactory->createLayoutLine(0,0, [$input, $addButton])];
        foreach ($config->get() as $element) {
            $elements[] = $this->getElementLine($config, $manialink, $element, $width, $manialinkFactory);
        }

        return $this->uiFactory->createLayoutRow(0, 0, $elements, 0.5);
    }
public function build ( ConfigInterface $ config , $ width , ManialinkInterface $ manialink , ManialinkFactory $ manialinkFactory ) : Renderable { $ input = $ this -> uiFactory -> createInput ( $ config -> getPath ( ) , '' ) -> setWidth ( $ width * 0.66 ) ; $ addButton = $ this -> uiFactory -> createButton ( 'Add' ) -> setWidth ( $ width * 0.33 ) -> setAction ( $ this -> actionFactory -> createManialinkAction ( $ manialink , function ( ManialinkInterface $ manialink , $ login , $ entries , $ args ) use ( $ manialinkFactory ) { /** @var TextListConfig $config */ $ config = $ args [ 'config' ] ; if ( ! empty ( $ entries [ $ config -> getPath ( ) ] ) ) { $ config -> add ( trim ( $ entries [ $ config -> getPath ( ) ] ) ) ; $ manialinkFactory -> update ( $ manialink -> getUserGroup ( ) ) ; } } , [ 'config' => $ config ] ) ) ; $ elements = [ $ this -> uiFactory -> createLayoutLine ( 0 , 0 , [ $ input , $ addButton ] ) ] ; foreach ( $ config -> get ( ) as $ element ) { $ elements [ ] = $ this -> getElementLine ( $ config , $ manialink , $ element , $ width , $ manialinkFactory ) ; } return $ this -> uiFactory -> createLayoutRow ( 0 , 0 , $ elements , 0.5 ) ; }
Create interface for the config value.

@param ConfigInterface $config

@return Renderable
Create interface for the config value .