当前位置: 首页>>代码示例>>PHP>>正文


PHP Form_Input::__construct方法代码示例

本文整理汇总了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']);
     }
 }
开发者ID:KyleJohnstonNet,项目名称:pfsense,代码行数:28,代码来源:Button.class.php

示例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;
 }
开发者ID:Spuffynism,项目名称:www,代码行数:8,代码来源:Form_File.class.php

示例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');
 }
开发者ID:michaeleino,项目名称:pfsense,代码行数:9,代码来源:Checkbox.class.php

示例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;
 }
开发者ID:NewEraCracker,项目名称:pfsense,代码行数:12,代码来源:Select.class.php

示例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;
     }
 }
开发者ID:NewEraCracker,项目名称:pfsense,代码行数:15,代码来源:IpAddress.class.php

示例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]);
         }
     }
 }
开发者ID:xafr,项目名称:gallery3,代码行数:19,代码来源:Form_Upload.php

示例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."));
 }
开发者ID:Joe7,项目名称:gallery3,代码行数:6,代码来源:Form_Recaptcha.php

示例8: __construct

 public function __construct($name, $form)
 {
     parent::__construct($name, $form);
     $this->attrs['type'] = 'checkbox';
 }
开发者ID:Yourgene,项目名称:scout,代码行数:5,代码来源:form.php

示例9: __construct

 public function __construct($name, $title, $value)
 {
     parent::__construct($name, $title, null);
     $this->_value = $value;
 }
开发者ID:KyleJohnstonNet,项目名称:pfsense,代码行数:5,代码来源:Textarea.class.php

示例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());
 }
开发者ID:Joe7,项目名称:gallery3,代码行数:5,代码来源:Form_Uploadify.php

示例11: __construct

 public function __construct($title, $text)
 {
     parent::__construct(null, $title);
     $this->_text = $text;
 }
开发者ID:KyleJohnstonNet,项目名称:pfsense,代码行数:5,代码来源:StaticText.class.php

示例12: __construct

 public function __construct($name, $title, $value)
 {
     parent::__construct($name, $title, 'text', $value);
     $this->_attributes['pattern'] = '[a-f0-9:.]*';
 }
开发者ID:LFCavalcanti,项目名称:pfsense,代码行数:5,代码来源:IpAddress.class.php

示例13: __construct

 public function __construct($name, $form)
 {
     parent::__construct($name, $form);
     $this->choices = array();
     unset($this->attrs['type']);
 }
开发者ID:Spuffynism,项目名称:www,代码行数:6,代码来源:Form_Select.class.php

示例14: __construct

 public function __construct($name, $form)
 {
     parent::__construct($name, $form);
     $this->attrs['type'] = 'text';
     $this->autocomplete = true;
 }
开发者ID:Spuffynism,项目名称:www,代码行数:6,代码来源:Form_Text.class.php


注:本文中的Form_Input::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。