本文整理匯總了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;
}