textBox() public method

Returns the xhtml for a text-based input.
public textBox ( string $FieldName, array $Attributes = [] ) : string
$FieldName string The name of the field that is being displayed/posted with this input. It should related directly to a field name in $this->_DataArray.
$Attributes array An associative array of attributes for the input. ie. maxlength, onclick, class, etc
return string
コード例 #1
0
ファイル: condition.php プロジェクト: caidongyun/vanilla
function writeConditionEdit($Condition, $Sender)
{
    $Px = $Sender->Prefix;
    $Form = new Gdn_Form();
    $Type = val(0, $Condition, '');
    $Field = val(1, $Condition, '');
    $Expr = val(2, $Condition, '');
    echo '<tr>';
    // Type.
    echo '<td>', $Form->DropDown($Px . 'Type[]', $Sender->Types, array('Value' => $Type, 'Class' => 'CondType')), '</td>';
    echo '<td>';
    // Permission fields.
    echo '<div class="Cond_permission"' . _DN($Type, Gdn_Condition::PERMISSION) . '>', $Form->DropDown($Px . 'PermissionField[]', $Sender->Permissions, array('Value' => $Type == Gdn_Condition::PERMISSION ? $Field : '')), '</div>';
    // Role fields.
    echo '<div class="Cond_role"' . _DN($Type, Gdn_Condition::ROLE) . '>', $Form->DropDown($Px . 'RoleField[]', $Sender->Roles, array('Value' => $Type == Gdn_Condition::ROLE ? $Field : '')), '</div>';
    // Textbox field.
    echo '<div class="Cond_request"' . _DN($Type, Gdn_Condition::REQUEST) . '>', $Form->textBox($Px . 'Field[]', array('Value' => $Type == Gdn_Condition::REQUEST ? $Field : ''));
    '</div>';
    echo '</td>';
    // Expression.
    echo '<td>', '<div class="Cond_request"' . _DN($Type, Gdn_Condition::REQUEST) . '>', $Form->textBox($Px . 'Expr[]', array('Value' => $Type == Gdn_Condition::REQUEST ? $Expr : '')), '</div>', '</td>';
    // Buttons.
    echo '<td align="right">', '<a href="#" class="DeleteCondition">', t('Delete'), '</a></td>';
    echo '</tr>';
}