本文整理汇总了PHP中Zend\View\Renderer\PhpRenderer::formSubmit方法的典型用法代码示例。如果您正苦于以下问题:PHP PhpRenderer::formSubmit方法的具体用法?PHP PhpRenderer::formSubmit怎么用?PHP PhpRenderer::formSubmit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\View\Renderer\PhpRenderer
的用法示例。
在下文中一共展示了PhpRenderer::formSubmit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderFieldset
/** {@inheritdoc} */
public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset)
{
$output = '';
if ($fieldset->has('Packages')) {
$packages = $fieldset->get('Packages');
if ($packages->count()) {
$formRow = $view->plugin('FormRow');
$translatorEnabled = $formRow->isTranslatorEnabled();
$formRow->setTranslatorEnabled(false);
$output = "<div class='table'>\n";
foreach ($packages as $package) {
$output .= $view->formRow($package, 'append') . "\n\n";
}
$output .= "<span class='cell'></span>\n";
$output .= $view->formSubmit($fieldset->get('Submit')) . "\n";
$output .= "</div>\n";
$formRow->setTranslatorEnabled($translatorEnabled);
}
}
return $output;
}
示例2: renderFieldset
/**
* Render all elements from a fieldset
*
* This method iterates over all elements from the given fieldset and
* renders them in a way appropriate for each element type. Subclasses with
* more specialized rendering may extend or replace this method.
*
* @param \Zend\View\Renderer\PhpRenderer $view
* @param \Zend\Form\Fieldset $fieldset
* @return string HTML code
*/
public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset)
{
$output = '<div class="table">';
foreach ($fieldset as $element) {
$row = '';
if ($element instanceof \Zend\Form\Element\Submit) {
$row .= "<span class='cell'></span>\n";
$row .= $view->formSubmit($element);
} elseif ($element instanceof \Zend\Form\Fieldset) {
$row .= $view->htmlTag('span', $view->translate($element->getLabel()), array('class' => 'label'), true) . "\n";
$row .= $view->htmlTag('fieldset', "<legend></legend>\n" . $this->renderFieldset($view, $element));
} elseif (!$element instanceof \Zend\Form\Element\Csrf) {
$row .= $view->formRow($element, 'prepend', false);
if ((string) $element->getLabel() == '') {
$row = "<div class='row'>\n<span class='label'></span>\n{$row}\n</div>";
}
if ($element->getMessages()) {
$row .= "\n<span class='cell'></span>\n";
$row .= $view->formElementErrors($element, array('class' => 'errors'));
}
if ($element->hasAttribute('id')) {
// The FormRow helper renders the label differently: It
// precedes the element instead of encapsulating it.
// Add a div wrapper to achieve the same appearance.
$row = "<div class='row'>\n{$row}\n</div>";
}
}
$output .= $row . "\n";
}
$output .= "</div>\n";
return $output;
}