本文整理汇总了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;
}
示例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;
}
示例3: render
public function render()
{
$output = '';
if (!empty($this->field)) {
$data = parent::setGeneralData();
$data['maxlength'] = 128;
$output = $this->renderField($data);
}
return $output;
}
示例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;
}
示例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;
}