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


PHP field::setGeneralData方法代碼示例

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


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

示例1: render

 public function render()
 {
     $output = '';
     if (!empty($this->field)) {
         $data = array();
         $data += parent::setGeneralData();
         if (isset($this->field['type']['maxlength']) && $this->field['type']['maxlength']) {
             $data['maxlength'] = $this->field['type']['maxlength'];
         } else {
             $data['maxlength'] = 32;
         }
         if ($this->field['code'] == 'captcha') {
             $setting = oc::registry()->config->get('quick_order_pro_setting');
             $data['maxlength'] = $setting['captcha_count_items'];
             $data['text_captcha_reload'] = oc::registry()->load->language->get('text_captcha_reload');
         }
         $data['mask'] = $data['placeholder'] = '';
         if (!empty($this->field['type']['use_mask']) && $this->field['type']['use_mask'] && !empty($this->field['type']['mask'])) {
             $data['mask'] = $this->field['type']['mask'];
             oc::registry()->document->addScript('catalog/view/javascript/quick_order_pro/jquery.maskedinput.min.js');
         }
         if (!empty($this->field['type']['placeholder'])) {
             $data['placeholder'] = $this->field['type']['placeholder'];
         }
         $output = $this->renderField($data);
     }
     return $output;
 }
開發者ID:SwayWebStudio,項目名稱:night.com,代碼行數:28,代碼來源:class.field.text.php

示例2: render

 public function render()
 {
     $output = '';
     if (!empty($this->field)) {
         $data = array();
         $data += parent::setGeneralData();
         $data['text_select'] = oc::registry()->load->language->get('text_select');
         $data['multiple'] = $this->field['type']['multiple'];
         if ($data['multiple']) {
             $data['class'] .= ($data['class'] ? ' ' : '') . 'multiple';
         }
         $data['selected'] = array();
         if ($data['value']) {
             if (is_array($data['value'])) {
                 $data['selected'] = $data['value'];
             } else {
                 $data['selected'][] = $data['value'];
             }
         } elseif (!empty($this->field['type']['selected'])) {
             $data['selected'][] = $this->field['type']['selected'];
         }
         if (!empty($this->field['type']['option']) && $this->field['type']['option']) {
             $data['option'] = $this->field['type']['option'];
         } else {
             return $output;
         }
         $output = $this->renderField($data);
     }
     return $output;
 }
開發者ID:SwayWebStudio,項目名稱:night.com,代碼行數:30,代碼來源:class.field.select.php

示例3: render

 public function render()
 {
     $output = '';
     if (!empty($this->field)) {
         $data = parent::setGeneralData();
         $data['maxlength'] = 128;
         $output = $this->renderField($data);
     }
     return $output;
 }
開發者ID:SwayWebStudio,項目名稱:night.com,代碼行數:10,代碼來源:class.field.password.php

示例4: render

 public function render()
 {
     $output = '';
     if (!empty($this->field)) {
         $data = array();
         $data += parent::setGeneralData();
         if (isset($this->field['type']['rows']) && (int) $this->field['type']['rows']) {
             $data['rows'] = (int) $this->field['type']['rows'];
         } else {
             $data['rows'] = 2;
         }
         $data['placeholder'] = $this->field['type']['placeholder'];
         $output = $this->renderField($data);
     }
     return $output;
 }
開發者ID:SwayWebStudio,項目名稱:night.com,代碼行數:16,代碼來源:class.field.textarea.php

示例5: render

 public function render()
 {
     $output = '';
     if (!empty($this->field)) {
         $data = array();
         $data += parent::setGeneralData();
         $data['checked'] = array();
         if ($this->isPOST()) {
             if ($data['value']) {
                 $data['checked'] = $data['value'];
             }
         } elseif (!empty($this->field['type']['checked'])) {
             $data['checked'] = $this->field['type']['checked'];
         }
         if (!empty($this->field['type']['option']) && $this->field['type']['option']) {
             $data['option'] = $this->field['type']['option'];
         } else {
             return $output;
         }
         $output = $this->renderField($data);
     }
     return $output;
 }
開發者ID:SwayWebStudio,項目名稱:night.com,代碼行數:23,代碼來源:class.field.checkbox.php


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