Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[idea] UI\Controls\Form::getChild(string $label) #17

Open
remicollet opened this issue Nov 3, 2016 · 1 comment
Open

[idea] UI\Controls\Form::getChild(string $label) #17

remicollet opened this issue Nov 3, 2016 · 1 comment

Comments

@remicollet
Copy link

For now, I'm using something like:

class ExtenfionForm extends Form {
	private $childIndex;
	private $childControl;

	public function addChild(string $name, string $label, UI\Control $control, boolean $stretchy=NULL) {

		$this->childIndex[$name] = $this->append($label, $control, $stretchy ?? false);
		$this->childControl[$name] = $control;
	}

	public function getChild(string $name) {

		return ($this->childControl[$name] ?? NULL);
	}
}

Perhaps we need something simpler.

@krakjoe
Copy link
Owner

krakjoe commented Nov 3, 2016

This is possible without any additional upstream change, we could do this.

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

No branches or pull requests

2 participants