Skip to content

Add common interface to ControlGroup and Container #131

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions