當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HTMLFormField::__construct方法代碼示例

本文整理匯總了PHP中HTMLFormField::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP HTMLFormField::__construct方法的具體用法?PHP HTMLFormField::__construct怎麽用?PHP HTMLFormField::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在HTMLFormField的用法示例。


在下文中一共展示了HTMLFormField::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * @param array $params
  */
 public function __construct($params)
 {
     parent::__construct($params);
     $this->msg = empty($params['licenses']) ? wfMessage('licenses')->inContentLanguage()->plain() : $params['licenses'];
     $this->selected = null;
     $this->makeLicenses();
 }
開發者ID:MediaWiki-stable,項目名稱:1.26.1,代碼行數:10,代碼來源:Licenses.php

示例2: __construct

 /**
  * @param array $params
  *   In adition to the usual HTMLFormField parameters, this can take the following fields:
  *   - flatlist: If given, the options will be displayed on a single line (wrapping to following
  *     lines if necessary), rather than each one on a line of its own. This is desirable mostly
  *     for very short lists of concisely labelled options.
  */
 public function __construct($params)
 {
     parent::__construct($params);
     if (isset($params['flatlist'])) {
         $this->mClass .= ' mw-htmlform-flatlist';
     }
 }
開發者ID:paladox,項目名稱:mediawiki,代碼行數:14,代碼來源:HTMLRadioField.php

示例3: __construct

 /**
  * Constructor
  *
  * @param $params array
  */
 public function __construct($params)
 {
     parent::__construct($params);
     $this->msg = empty($params['licenses']) ? wfMsg('licenses') : $params['licenses'];
     $this->selected = null;
     $this->makeLicenses();
 }
開發者ID:eFFemeer,項目名稱:seizamcore,代碼行數:12,代碼來源:Licenses.php

示例4: __construct

 public function __construct($params)
 {
     parent::__construct($params);
     # Per HTML5 spec, hidden fields cannot be 'required'
     # http://www.w3.org/TR/html5/forms.html#hidden-state-%28type=hidden%29
     unset($this->mParams['required']);
 }
開發者ID:whysasse,項目名稱:kmwiki,代碼行數:7,代碼來源:HTMLHiddenField.php

示例5: __construct

 public function __construct($params)
 {
     parent::__construct($params);
     # Per HTML5 spec, hidden fields cannot be 'required'
     # http://dev.w3.org/html5/spec/states-of-the-type-attribute.html#hidden-state
     unset($this->mParams['required']);
 }
開發者ID:Tarendai,項目名稱:spring-website,代碼行數:7,代碼來源:HTMLHiddenField.php

示例6: __construct

 public function __construct($info)
 {
     $info['nodata'] = true;
     if (isset($info['flags'])) {
         $this->mFlags = $info['flags'];
     }
     # Generate the label from a message, if possible
     if (isset($info['buttonlabel-message'])) {
         $msgInfo = $info['buttonlabel-message'];
         if (is_array($msgInfo)) {
             $msg = array_shift($msgInfo);
         } else {
             $msg = $msgInfo;
             $msgInfo = array();
         }
         $this->buttonLabel = $this->msg($msg, $msgInfo)->parse();
     } elseif (isset($info['buttonlabel'])) {
         if ($info['buttonlabel'] === ' ') {
             // Apparently some things set &nbsp directly and in an odd format
             $this->buttonLabel = ' ';
         } else {
             $this->buttonLabel = htmlspecialchars($info['buttonlabel']);
         }
     } elseif (isset($info['buttonlabel-raw'])) {
         $this->buttonLabel = $info['buttonlabel-raw'];
     }
     parent::__construct($info);
 }
開發者ID:Kaph-Noir,項目名稱:mediawiki,代碼行數:28,代碼來源:HTMLButtonField.php

示例7: __construct

 public function __construct($params)
 {
     $missing = array_diff(self::$requiredParams, array_keys($params));
     if ($missing) {
         throw new HTMLFormFieldRequiredOptionsException($this, $missing);
     }
     parent::__construct($params);
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:8,代碼來源:HTMLCheckMatrix.php

示例8: __construct

 public function __construct($info)
 {
     $info['nodata'] = true;
     if (isset($info['flags'])) {
         $this->mFlags = $info['flags'];
     }
     parent::__construct($info);
 }
開發者ID:KaralisWebLabs,項目名稱:mediawiki,代碼行數:8,代碼來源:HTMLButtonField.php

示例9: __construct

 public function __construct($params)
 {
     parent::__construct($params);
     // For differentiating the type of form, mainly
     if (isset($params['prefix'])) {
         $this->prefix = $params['prefix'];
     }
 }
開發者ID:Grprashanthkumar,項目名稱:ColfusionWeb,代碼行數:8,代碼來源:HTMLCaptchaField.php

示例10: __construct

 /**
  * @param array $params
  *   - type: HTML textfield type
  *   - size: field size in characters (defaults to 45)
  *   - placeholder/placeholder-message: set HTML placeholder attribute
  *   - spellcheck: set HTML spellcheck attribute
  *   - persistent: upon unsuccessful requests, retain the value (defaults to true, except
  *     for password fields)
  */
 public function __construct($params)
 {
     parent::__construct($params);
     if (isset($params['placeholder-message'])) {
         $this->mPlaceholder = $this->getMessage($params['placeholder-message'])->parse();
     } elseif (isset($params['placeholder'])) {
         $this->mPlaceholder = $params['placeholder'];
     }
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:18,代碼來源:HTMLTextField.php

示例11: __construct

 public function __construct($params)
 {
     parent::__construct($params);
     if (isset($this->mParams['output-as-default'])) {
         $this->outputAsDefault = (bool) $this->mParams['output-as-default'];
     }
     # Per HTML5 spec, hidden fields cannot be 'required'
     # http://www.w3.org/TR/html5/forms.html#hidden-state-%28type=hidden%29
     unset($this->mParams['required']);
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:10,代碼來源:HTMLHiddenField.php

示例12: __construct

 /**
  * @param array $params
  *   In adition to the usual HTMLFormField parameters, this can take the following fields:
  *   - dropdown: If given, the options will be displayed inside a dropdown with a text field that
  *     can be used to filter them. This is desirable mostly for very long lists of options.
  *     This only works for users with JavaScript support and falls back to the list of checkboxes.
  *   - flatlist: If given, the options will be displayed on a single line (wrapping to following
  *     lines if necessary), rather than each one on a line of its own. This is desirable mostly
  *     for very short lists of concisely labelled options.
  */
 public function __construct($params)
 {
     parent::__construct($params);
     // For backwards compatibility, also handle the old way with 'cssclass' => 'mw-chosen'
     if (isset($params['dropdown']) || strpos($this->mClass, 'mw-chosen') !== false) {
         $this->mClass .= ' mw-htmlform-dropdown';
     }
     if (isset($params['flatlist'])) {
         $this->mClass .= ' mw-htmlform-flatlist';
     }
 }
開發者ID:paladox,項目名稱:mediawiki,代碼行數:21,代碼來源:HTMLMultiSelectField.php

示例13: __construct

 public function __construct($info)
 {
     if (isset($info['buttonclass'])) {
         $this->mButtonClass = $info['buttonclass'];
     }
     if (isset($info['buttonid'])) {
         $this->mButtonId = $info['buttonid'];
     }
     if (isset($info['buttonname'])) {
         $this->mButtonName = $info['buttonname'];
     }
     if (isset($info['buttondefault'])) {
         $this->mButtonValue = $info['buttondefault'];
     }
     if (isset($info['buttontype'])) {
         $this->mButtonType = $info['buttontype'];
     }
     parent::__construct($info);
 }
開發者ID:D66Ha,項目名稱:mediawiki,代碼行數:19,代碼來源:HTMLFormFieldWithButton.php

示例14: __construct

 public function __construct($params)
 {
     $this->uniqueId = get_class($this) . ++self::$counter . 'x';
     parent::__construct($params);
     if (empty($this->mParams['fields']) || !is_array($this->mParams['fields'])) {
         throw new MWException('HTMLFormFieldCloner called without any fields');
     }
     // Make sure the delete button, if explicitly specified, is sane
     if (isset($this->mParams['fields']['delete'])) {
         $class = 'mw-htmlform-cloner-delete-button';
         $info = $this->mParams['fields']['delete'] + ['cssclass' => $class];
         unset($info['name'], $info['class']);
         if (!isset($info['type']) || $info['type'] !== 'submit') {
             throw new MWException('HTMLFormFieldCloner delete field, if specified, must be of type "submit"');
         }
         if (!in_array($class, explode(' ', $info['cssclass']))) {
             $info['cssclass'] .= " {$class}";
         }
         $this->mParams['fields']['delete'] = $info;
     }
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:21,代碼來源:HTMLFormFieldCloner.php

示例15: __construct

 public function __construct($info)
 {
     $info['nodata'] = true;
     if (isset($info['flags'])) {
         $this->mFlags = $info['flags'];
     }
     # Generate the label from a message, if possible
     if (isset($info['buttonlabel-message'])) {
         $this->buttonLabel = $this->getMessage($info['buttonlabel-message'])->parse();
     } elseif (isset($info['buttonlabel'])) {
         if ($info['buttonlabel'] === ' ') {
             // Apparently some things set &nbsp directly and in an odd format
             $this->buttonLabel = ' ';
         } else {
             $this->buttonLabel = htmlspecialchars($info['buttonlabel']);
         }
     } elseif (isset($info['buttonlabel-raw'])) {
         $this->buttonLabel = $info['buttonlabel-raw'];
     }
     $this->setShowEmptyLabel(false);
     parent::__construct($info);
 }
開發者ID:claudinec,項目名稱:galan-wiki,代碼行數:22,代碼來源:HTMLButtonField.php


注:本文中的HTMLFormField::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。