本文整理汇总了PHP中Form_Input::_getInput方法的典型用法代码示例。如果您正苦于以下问题:PHP Form_Input::_getInput方法的具体用法?PHP Form_Input::_getInput怎么用?PHP Form_Input::_getInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form_Input
的用法示例。
在下文中一共展示了Form_Input::_getInput方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getInput
protected function _getInput()
{
$element = parent::_getInput();
$options = '';
foreach ($this->_values as $value => $name) {
// Things can get weird if we have mixed types
$sval = $this->_value;
if (gettype($value) == "integer" && gettype($sval) == "string") {
$value = strval($value);
}
if (isset($this->_attributes['multiple'])) {
$selected = in_array($value, (array) $sval);
} else {
$selected = $sval == $value;
}
if (!empty(trim($name)) || is_numeric($name)) {
$name_str = htmlspecialchars(gettext($name));
} else {
// Fixes HTML5 validation: Element option without attribute label must not be empty
$name_str = " ";
}
$options .= '<option value="' . htmlspecialchars($value) . '"' . ($selected ? ' selected' : '') . '>' . $name_str . '</option>';
}
return <<<EOT
\t{$element}
\t\t{$options}
\t</select>
EOT;
}
示例2: _getInput
protected function _getInput()
{
$element = parent::_getInput();
$options = '';
foreach ($this->_values as $value => $name) {
// Things can get wierd if we have mixed types
$sval = $this->_value;
if (gettype($value) == "integer" && gettype($sval) == "string") {
$value = strval($value);
}
if (isset($this->_attributes['multiple'])) {
$selected = in_array($value, (array) $sval);
} else {
$selected = $sval == $value;
}
if (!empty($name) || $name == '0') {
$options .= '<option value="' . htmlspecialchars($value) . '"' . ($selected ? ' selected' : '') . '>' . htmlspecialchars(gettext($name)) . '</option>';
}
}
return <<<EOT
\t{$element}
\t\t{$options}
\t</select>
EOT;
}
示例3: _getInput
protected function _getInput()
{
$input = parent::_getInput();
if (!isset($this->_attributes['href'])) {
return $input;
}
return $input . htmlspecialchars($this->_title) . '</a>';
}
示例4: _getInput
protected function _getInput()
{
$element = parent::_getInput();
$value = htmlspecialchars($this->_value);
return <<<EOT
\t{$element}{$value}</textarea>
EOT;
}
示例5: _getInput
protected function _getInput()
{
$input = parent::_getInput();
if (!isset($this->_description)) {
return $input;
}
return '<label>' . $input . ' ' . htmlspecialchars(gettext($this->_description)) . '</label>';
}
示例6: _getInput
protected function _getInput()
{
$input = parent::_getInput();
if (empty($this->_description)) {
return '<label class="chkboxlbl">' . $input . '</label>';
}
return '<label class="chkboxlbl">' . $input . ' ' . htmlspecialchars(gettext($this->_description)) . '</label>';
}
示例7: _getInput
protected function _getInput()
{
$input = parent::_getInput();
if (!isset($this->_mask)) {
return $input;
}
return <<<EOT
\t\t<div class="input-group">
\t\t\t{$input}
\t\t\t<span class="input-group-addon input-group-inbetween pfIpMask">/</span>
\t\t\t{$this->_mask}
\t\t</div>
EOT;
}