Skip to content

Add common interface to ControlGroup and Container #131

@richard-ejem

Description

@richard-ejem

Common interface declaring getControls() would be useful for form renderers including DefaultFormRenderer.

Example:

interface IControlContainer
{
    /** @return IControl[] */
    public function getControls();
}

then, DefaultFormRenderer::renderControls() could look like:

public function renderControls(Nette\Forms\IControlContainer $parent) {
    # got rid of this check:
    # if (!($parent instanceof Nette\Forms\Container || $parent instanceof Nette\Forms\ControlGroup)) {
    #     throw new Nette\InvalidArgumentException('Argument must be Nette\Forms\Container or Nette\Forms\ControlGroup instance.');
    # }
}

If agreed, I can pullrequest it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions