本文整理汇总了PHP中Form_Input::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Form_Input::__construct方法的具体用法?PHP Form_Input::__construct怎么用?PHP Form_Input::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form_Input
的用法示例。
在下文中一共展示了Form_Input::__construct方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($name, $title, $link = null, $icon = null)
{
// If we have a link; we're actually an <a class='btn'>
if (isset($link)) {
$this->_attributes['href'] = $link;
$this->_tagName = 'a';
$this->addClass('btn-default');
unset($this->_attributes['type']);
if (isset($icon)) {
$this->_attributes['icon'] = $icon;
}
} else {
if (isset($icon)) {
$this->_tagSelfClosing = false;
$this->_tagName = 'button';
$this->_attributes['value'] = gettext($title);
$this->_attributes['icon'] = $icon;
} else {
$this->_tagSelfClosing = true;
$this->_attributes['value'] = gettext($title);
$this->addClass('btn-primary');
}
}
parent::__construct($name, $title, null);
if (isset($link)) {
unset($this->_attributes['name']);
}
}
示例2: __construct
public function __construct($name, $form)
{
parent::__construct($name, $form);
$this->attrs['type'] = 'file';
$this->form->enctype('multipart/form-data');
$this->extensions = array();
$this->max_size = 0;
}
示例3: __construct
public function __construct($name, $title, $description, $checked, $value = 'yes')
{
parent::__construct($name, $title, 'checkbox', $value);
$this->_description = $description;
if ($checked) {
$this->_attributes['checked'] = 'checked';
}
$this->column->addClass('checkbox');
}
示例4: __construct
public function __construct($name, $title, $value, array $values, $allowMultiple = false)
{
if ($allowMultiple) {
$name .= '[]';
}
parent::__construct($name, $title, null);
if ($allowMultiple) {
$this->_attributes['multiple'] = 'multiple';
}
$this->_value = $value;
$this->_values = $values;
}
示例5: __construct
public function __construct($name, $title, $value, $type = "BOTH")
{
parent::__construct($name, $title, 'text', $value);
switch ($type) {
case "BOTH":
$this->_attributes['pattern'] = '[a-f0-9:.]*';
break;
case "V4":
$this->_attributes['pattern'] = '[0-9.]*';
break;
case "V6":
$this->_attributes['pattern'] = '[a-f0-9:]*';
break;
}
}
示例6: __construct
public function __construct($name, $filename = FALSE)
{
parent::__construct($name);
if (!empty($_FILES[$name])) {
if (empty($_FILES[$name]['tmp_name']) or is_uploaded_file($_FILES[$name]['tmp_name'])) {
// Cache the upload data in this object
$this->upload = $_FILES[$name];
// Hack to allow file-only inputs, where no POST data is present
$_POST[$name] = $this->upload['name'];
// Set the filename
$this->filename = empty($filename) ? FALSE : $filename;
} else {
// Attempt to delete the invalid file
is_writable($_FILES[$name]['tmp_name']) and unlink($_FILES[$name]['tmp_name']);
// Invalid file upload, possible hacking attempt
unset($_FILES[$name]);
}
}
}
示例7: __construct
public function __construct($name)
{
parent::__construct($name);
$this->error_messages("incorrect-captcha-sol", t("The values supplied to reCAPTCHA are incorrect."));
$this->error_messages("invalid-site-private-key", t("The site private key is incorrect."));
}
示例8: __construct
public function __construct($name, $form)
{
parent::__construct($name, $form);
$this->attrs['type'] = 'checkbox';
}
示例9: __construct
public function __construct($name, $title, $value)
{
parent::__construct($name, $title, null);
$this->_value = $value;
}
示例10: __construct
public function __construct($name)
{
parent::__construct($name);
$this->data["script_data"] = array("g3sid" => Session::instance()->id(), "user_agent" => Input::instance()->server("HTTP_USER_AGENT"), "csrf" => access::csrf_token());
}
示例11: __construct
public function __construct($title, $text)
{
parent::__construct(null, $title);
$this->_text = $text;
}
示例12: __construct
public function __construct($name, $title, $value)
{
parent::__construct($name, $title, 'text', $value);
$this->_attributes['pattern'] = '[a-f0-9:.]*';
}
示例13: __construct
public function __construct($name, $form)
{
parent::__construct($name, $form);
$this->choices = array();
unset($this->attrs['type']);
}
示例14: __construct
public function __construct($name, $form)
{
parent::__construct($name, $form);
$this->attrs['type'] = 'text';
$this->autocomplete = true;
}