本文整理汇总了PHP中Zend\Form\FormInterface::getInputByElement方法的典型用法代码示例。如果您正苦于以下问题:PHP FormInterface::getInputByElement方法的具体用法?PHP FormInterface::getInputByElement怎么用?PHP FormInterface::getInputByElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Form\FormInterface
的用法示例。
在下文中一共展示了FormInterface::getInputByElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareElement
/**
* @see Zend\Form\Element\Collection
*/
public function prepareElement(FormInterface $form)
{
Form::workOnElement($form->getInputByElement($this), $this->getTargetElement());
if (true === $this->shouldCreateChildrenOnPrepareElement) {
if ($this->targetElement !== null && $this->count > 0 && $this->_collection) {
while ($this->count > $this->lastChildIndex + 1 && $this->lastChildIndex + 2 <= count($this->_collection)) {
$this->addNewTargetElementInstance($this->_collection[++$this->lastChildIndex]);
}
}
}
// Create a template that will also be prepared
if ($this->shouldCreateTemplate) {
$templateElement = $this->getTemplateElement();
$this->add($templateElement);
parent::prepareElement($form);
// The template element has been prepared, but we don't want it to be
// rendered nor validated, so remove it from the list.
if ($this->shouldCreateTemplate) {
$this->remove($this->templatePlaceholder);
}
}
}