本文整理匯總了PHP中Zend\View\Renderer\PhpRenderer::formText方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhpRenderer::formText方法的具體用法?PHP PhpRenderer::formText怎麽用?PHP PhpRenderer::formText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend\View\Renderer\PhpRenderer
的用法示例。
在下文中一共展示了PhpRenderer::formText方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: renderFieldset
/** {@inheritdoc} */
public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset = null)
{
$output = "<div class='table'>\n";
$fields = $this->get('Fields');
foreach ($this->_definedFields as $name => $type) {
$element = $fields->get($name);
if ($element->getMessages()) {
$element->setAttribute('class', 'input-error');
}
$row = $view->formText($element) . "\n";
$row .= $view->htmlTag('span', $view->translate($type), array('class' => 'cell'));
$row .= $view->htmlTag('span', $view->htmlTag('a', $view->translate('Delete'), array('href' => $view->consoleUrl('preferences', 'deletefield', array('name' => $name))), true), array('class' => 'cell'));
$output .= $view->htmlTag('div', $row, array('class' => 'row'));
$output .= $view->formElementErrors($element, array('class' => 'error'));
$output .= "\n";
}
$newName = $this->get('NewName');
$output .= $view->htmlTag('div', $view->formRow($newName, null, false) . $view->formRow($this->get('NewType')), array('class' => 'row'));
$output .= $view->formElementErrors($newName, array('class' => 'error'));
$output .= $view->formRow($this->get('Submit'));
$output .= "\n</div>\n";
return $output;
}
示例2: renderFieldset
/** {@inheritdoc} */
public function renderFieldset(\Zend\View\Renderer\PhpRenderer $view, \Zend\Form\Fieldset $fieldset = null)
{
$output = "<div class='table'>\n";
$types = $this->get('Types');
foreach ($this->_definedTypes as $name => $count) {
$element = $types->get($name);
if ($element->getMessages()) {
$element->setAttribute('class', 'input-error');
}
$row = $view->formText($element);
if ($count == 0) {
$row .= $view->htmlElement('a', $view->translate('Delete'), array('href' => $view->consoleUrl('preferences', 'deletedevicetype', array('name' => $name))), true);
}
$output .= $view->htmlElement('div', $row);
$output .= $view->formElementErrors($element, array('class' => 'error'));
$output .= "\n";
}
$add = $this->get('Add');
$output .= $view->formRow($add, null, false);
$output .= $view->formElementErrors($add, array('class' => 'error'));
$output .= $view->formRow($this->get('Submit'));
$output .= "\n</div>\n";
return $output;
}