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


PHP Widget::__set方法代碼示例

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


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

示例1: __set

 /**
  * Add specific attributes
  *
  * @param string $strKey   The attribute key
  * @param mixed  $varValue The attribute value
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'maxlength':
             if ($varValue > 0) {
                 $this->arrAttributes['maxlength'] = $varValue;
             }
             break;
         case 'mandatory':
             if ($varValue) {
                 $this->arrAttributes['required'] = 'required';
             } else {
                 unset($this->arrAttributes['required']);
             }
             parent::__set($strKey, $varValue);
             break;
         case 'min':
         case 'max':
         case 'step':
         case 'placeholder':
             $this->arrAttributes[$strKey] = $varValue;
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:Mozan,項目名稱:core-bundle,代碼行數:33,代碼來源:FormTextField.php

示例2: __set

 /**
  * Add specific attributes
  * @param string
  * @param mixed
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'mSize':
             if ($this->multiple) {
                 $this->arrAttributes['size'] = $varValue;
             }
             break;
         case 'options':
             $this->arrOptions = deserialize($varValue);
             break;
         case 'multiple':
             if (strlen($varValue)) {
                 $this->arrAttributes[$strKey] = 'multiple';
             }
             break;
         case 'mandatory':
             $this->arrConfiguration['mandatory'] = $varValue ? true : false;
             break;
         case 'rgxp':
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:Juuro,項目名稱:Dreamapp-Website,代碼行數:31,代碼來源:FormSelectMenu.php

示例3: __set

 /**
  * Add specific attributes
  * @param string
  * @param mixed
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'mSize':
             if ($this->multiple) {
                 $this->arrAttributes['size'] = $varValue;
             }
             break;
         case 'efgLookupOptions':
             $this->import('Formdata');
             $this->arrConfiguration['efgLookupOptions'] = $varValue;
             $arrOptions = $this->Formdata->prepareWidgetOptions($this->arrConfiguration);
             $this->arrOptions = $arrOptions;
             break;
         case 'multiple':
             if (strlen($varValue)) {
                 $this->arrAttributes[$strKey] = 'multiple';
             }
             break;
         case 'mandatory':
             $this->arrConfiguration['mandatory'] = $varValue ? true : false;
             break;
         case 'rgxp':
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:Jobu,項目名稱:core,代碼行數:34,代碼來源:EfgFormLookupSelectMenu.php

示例4: __set

 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'maxlength':
             $this->arrAttributes[$strKey] = $varValue > 0 ? $varValue : '';
             break;
         case 'mandatory':
             if (VERSION == 2.9 || VERSION == 2.1) {
                 $this->arrConfiguration['mandatory'] = $varValue ? true : false;
             } else {
                 if ($varValue) {
                     $this->arrAttributes['required'] = 'required';
                 } else {
                     unset($this->arrAttributes['required']);
                 }
                 parent::__set($strKey, $varValue);
             }
             break;
         case 'placeholder':
             $this->arrAttributes['placeholder'] = $varValue;
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:heimrichhannot,項目名稱:contao-confirmed_email,代碼行數:26,代碼來源:FormConfirmedEmail.php

示例5: __set

 /**
  * Add specific attributes
  * @param string
  * @param mixed
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'maxlength':
             if ($varValue > 0) {
                 $this->arrAttributes['maxlength'] = $varValue;
             }
             break;
         case 'mandatory':
             if ($varValue) {
                 $this->arrAttributes['required'] = 'required';
             } else {
                 unset($this->arrAttributes['required']);
             }
             parent::__set($strKey, $varValue);
             break;
         case 'rows':
             $this->intRows = $varValue;
             break;
         case 'cols':
             $this->intCols = $varValue;
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:iCodr8,項目名稱:core,代碼行數:32,代碼來源:TextArea.php

示例6: __set

 /**
  * Add specific attributes
  *
  * @param string $strKey
  * @param mixed  $varValue
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'maxlength':
             if ($varValue > 0) {
                 $this->arrAttributes['maxlength'] = $varValue;
             }
             break;
         case 'mandatory':
             if ($varValue) {
                 $this->arrAttributes['required'] = 'required';
             } else {
                 unset($this->arrAttributes['required']);
             }
             parent::__set($strKey, $varValue);
             break;
         case 'placeholder':
             $this->arrAttributes['placeholder'] = $varValue;
             break;
         case 'options':
             $this->arrUnits = \StringUtil::deserialize($varValue);
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:contao,項目名稱:core-bundle,代碼行數:33,代碼來源:InputUnit.php

示例7: __set

 /**
  * Add specific attributes
  *
  * @param string $strKey   The attribute name
  * @param mixed  $varValue The attribute value
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'singleSRC':
             $this->arrConfiguration['singleSRC'] = $varValue;
             break;
         case 'imageSubmit':
             $this->arrConfiguration['imageSubmit'] = $varValue ? true : false;
             break;
         case 'name':
             $this->arrAttributes['name'] = $varValue;
             break;
         case 'label':
             $this->slabel = $varValue;
             break;
         case 'required':
         case 'mandatory':
         case 'minlength':
         case 'maxlength':
             // Ignore
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:StephenGWills,項目名稱:sample-contao-app,代碼行數:32,代碼來源:FormSubmit.php

示例8: __set

 /**
  * Add specific attributes
  *
  * @param string $strKey
  * @param mixed  $varValue
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'mandatory':
             if ($varValue) {
                 $this->arrAttributes['required'] = 'required';
             } else {
                 unset($this->arrAttributes['required']);
             }
             parent::__set($strKey, $varValue);
             break;
         case 'size':
             if ($this->multiple) {
                 $this->arrAttributes['size'] = $varValue;
             }
             break;
         case 'multiple':
             if ($varValue) {
                 $this->arrAttributes['multiple'] = 'multiple';
             }
             break;
         case 'options':
             $this->arrOptions = \StringUtil::deserialize($varValue);
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:contao,項目名稱:core-bundle,代碼行數:35,代碼來源:SelectMenu.php

示例9: __set

 /**
  * Add specific attributes
  * @param string
  * @param mixed
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'maxlength':
             if ($varValue > 0) {
                 $this->arrAttributes['maxlength'] = $varValue;
             }
             break;
         case 'mandatory':
             if ($varValue) {
                 $this->arrAttributes['required'] = 'required';
             } else {
                 unset($this->arrAttributes['required']);
             }
             parent::__set($strKey, $varValue);
             break;
         case 'placeholder':
             $this->arrAttributes['placeholder'] = $varValue;
             break;
         case 'size':
             $arrSize = deserialize($varValue);
             $this->intRows = $arrSize[0];
             $this->intCols = $arrSize[1];
             break;
         case 'rows':
             $this->intRows = $varValue;
             break;
         case 'cols':
             $this->intCols = $varValue;
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:rikaix,項目名稱:core,代碼行數:40,代碼來源:FormTextArea.php

示例10: __set

 /**
  * Add specific attributes
  * @param string
  * @param mixed
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'maxlength':
             // Do not add as attribute (see #3094)
             $this->arrConfiguration['maxlength'] = $varValue;
             break;
         case 'mandatory':
             if ($varValue) {
                 $this->arrAttributes['required'] = 'required';
             } else {
                 unset($this->arrAttributes['required']);
             }
             parent::__set($strKey, $varValue);
             break;
         case 'fSize':
             if ($varValue > 0) {
                 $this->arrAttributes['size'] = $varValue;
             }
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:rburch,項目名稱:core,代碼行數:30,代碼來源:FormFileUpload.php

示例11: __set

 /**
  * Add specific attributes
  *
  * @param string $strKey   The attribute name
  * @param mixed  $varValue The attribute value
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'mandatory':
             if ($varValue) {
                 $this->arrAttributes['required'] = 'required';
             } else {
                 unset($this->arrAttributes['required']);
             }
             parent::__set($strKey, $varValue);
             break;
         case 'mSize':
             if ($this->multiple) {
                 $this->arrAttributes['size'] = $varValue;
             }
             break;
         case 'multiple':
             if ($varValue != '') {
                 $this->arrAttributes['multiple'] = 'multiple';
             }
             break;
         case 'options':
             $this->arrOptions = deserialize($varValue);
             break;
         case 'rgxp':
         case 'minlength':
         case 'maxlength':
             // Ignore
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:Mozan,項目名稱:core-bundle,代碼行數:40,代碼來源:FormSelectMenu.php

示例12: __set

 /**
  * Add specific attributes
  *
  * @param string
  * @param mixed
  */
 public function __set($key, $value)
 {
     switch ($key) {
         default:
             parent::__set($key, $value);
             break;
     }
 }
開發者ID:Ainschy,項目名稱:contao-core,代碼行數:14,代碼來源:WidgetEventchooser.php

示例13: __set

 /**
  * Add specific attributes
  *
  * @param string $strKey
  * @param mixed  $varValue
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'options':
             $this->arrOptions = deserialize($varValue);
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:StephenGWills,項目名稱:sample-contao-app,代碼行數:17,代碼來源:CheckBox.php

示例14: __set

 /**
  * Add specific attributes
  * @param string
  * @param mixed
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'mandatory':
             $this->arrConfiguration['mandatory'] = $varValue ? true : false;
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:Jobu,項目名稱:core,代碼行數:16,代碼來源:EfgFormImageSelect.php

示例15: __set

 /**
  * Add specific attributes
  * @param string
  * @param mixed
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'required':
         case 'mandatory':
             // Is set by default
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }
開發者ID:jens-wetzel,項目名稱:use2,代碼行數:17,代碼來源:FormCaptcha.php


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