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


PHP FormField::getElement方法代码示例

本文整理汇总了PHP中FormField::getElement方法的典型用法代码示例。如果您正苦于以下问题:PHP FormField::getElement方法的具体用法?PHP FormField::getElement怎么用?PHP FormField::getElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FormField的用法示例。


在下文中一共展示了FormField::getElement方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getElement

 public function getElement($value = "", $group = "", $html = "")
 {
     if ($group) {
         $this->group = $group;
         $this->fieldname = $this->getFieldName($this->fieldname);
     }
     $this->value = $value;
     $class = 'select';
     $default = isset($this->element['default']) ? $this->element['default'] : "";
     $this->value = $this->value == "" || $this->value == null ? $default : $this->value;
     $class .= isset($this->element['class']) ? (string) $this->element['class'] : '';
     $style = isset($this->element['style']) ? (string) $this->element['style'] : '';
     $size = isset($this->element['size']) ? (string) $this->element['size'] : '30';
     $multiple = isset($this->element['multiple']) ? (string) $this->element['multiple'] : false;
     if ($multiple) {
         $multiple = ' multiple="multiple" ';
         $this->name .= "[]";
     } else {
         $multiple = "";
     }
     $html = '<select name="' . $this->name . '" class="' . $class . '"' . $multiple . ' style="' . $style . '">';
     $blocks = Mage::getModel('cms/block')->getCollection()->addFilter("is_active", 1)->getItems();
     $html .= '<option value="0">' . Mage::helper('ves_tempcp')->__("---- Select a Static Block ----") . '</option>';
     if (!empty($blocks)) {
         foreach ($blocks as $block) {
             if ($block->getIdentifier() == $this->value) {
                 $html .= '<option value="' . $block->getIdentifier() . '" selected="selected">' . $block->getTitle() . '</option>';
             } else {
                 $html .= '<option value="' . $block->getIdentifier() . '">' . $block->getTitle() . '</option>';
             }
         }
     }
     $html .= '</select>';
     return parent::getElement($value, $group, $html);
 }
开发者ID:quanghuynt93,项目名称:VesSmartshop,代码行数:35,代码来源:staticblocklist.php

示例2: getElement

 public function getElement($value = "", $group = "", $html = "")
 {
     if ($group) {
         $this->group = $group;
         $this->fieldname = $this->getFieldName($this->fieldname);
     }
     $this->value = $value;
     $class = isset($this->element['class']) ? (string) $this->element['class'] : '';
     $style = isset($this->element['style']) ? (string) $this->element['style'] : '';
     $max_length = isset($this->element['max_length']) ? (string) $this->element['max_length'] : '150';
     $size = isset($this->element['size']) ? (string) $this->element['size'] : '30';
     $html = '<input type="text" name="' . $this->name . '" max_length="' . $max_length . '" size="' . $size . '" style="' . $style . '" class="' . $class . '" value="' . $this->value . '"/>';
     return parent::getElement($value, $group, $html);
 }
开发者ID:quanghuynt93,项目名称:VesSmartshop,代码行数:14,代码来源:input.php

示例3: getElement

 public function getElement($value = "", $group = "", $html = "")
 {
     if ($group) {
         $this->group = $group;
         $this->fieldname = $this->getFieldName($this->fieldname);
     }
     $this->value = $value;
     $class = isset($this->element['class']) ? (string) $this->element['class'] : '';
     $cols = isset($this->element['cols']) ? (string) $this->element['cols'] : '25';
     $rows = isset($this->element['rows']) ? (string) $this->element['rows'] : '10';
     $width = isset($this->element['width']) ? (string) $this->element['width'] : '400px';
     $height = isset($this->element['height']) ? (string) $this->element['height'] : '300px';
     $html = Mage::helper('ves_tempcp/element')->getElementEditor($this->group . '_' . $this->fieldname, $this->name, $value, 'class="' . $class . '" cols="' . $cols . '" rows="' . $rows . '" style="width:' . $width . ';height:' . $height . '"');
     return parent::getElement($value, $group, $html);
 }
开发者ID:quanghuynt93,项目名称:VesSmartshop,代码行数:15,代码来源:editor.php

示例4: getElement

 public function getElement($value = "", $group = "", $html = "")
 {
     if ($group) {
         $this->group = $group;
         $this->fieldname = $this->getFieldName($this->fieldname);
     }
     $this->value = $value;
     $class = isset($this->element['class']) ? (string) $this->element['class'] : '';
     $cols = isset($this->element['cols']) ? (string) $this->element['cols'] : '25';
     $rows = isset($this->element['rows']) ? (string) $this->element['rows'] : '10';
     $width = isset($this->element['width']) ? (string) $this->element['width'] : '400px';
     $height = isset($this->element['height']) ? (string) $this->element['height'] : '300px';
     $html = '<textarea name="' . $this->name . '" id="' . $this->group . '_' . $this->fieldname . '" class="' . $class . '" cols="' . $cols . '" rows="' . $rows . '" style="width:' . $width . ';height:' . $height . '">' . $value . '</textarea>';
     return parent::getElement($value, $group, $html);
 }
开发者ID:booklein,项目名称:bookle,代码行数:15,代码来源:Textarea.php

示例5: getElement

 public function getElement($value = "", $group = "", $html = "")
 {
     if ($group) {
         $this->group = $group;
         $this->fieldname = $this->getFieldName($this->fieldname);
     }
     $this->value = $value;
     $class = 'select';
     $default = isset($this->element['default']) ? $this->element['default'] : "";
     $this->value = empty($this->value) ? $default : $this->value;
     $class .= isset($this->element['class']) ? (string) $this->element['class'] : '';
     $style = isset($this->element['style']) ? (string) $this->element['style'] : '';
     $size = isset($this->element['size']) ? ' size="' . (string) $this->element['size'] . '"' : '';
     $vars = get_object_vars($this->element);
     $options = $vars['option'];
     $options = $this->getOptions($options);
     $multiple = isset($this->element['multiple']) ? (string) $this->element['multiple'] : true;
     if ($multiple) {
         $multiple = ' multiple="multiple" ';
         $class .= ' multiselect';
         $this->name .= "[]";
     } else {
         $multiple = "";
     }
     $html = '<select name="' . $this->name . '" class="' . $class . '"' . $multiple . $size . ' style="' . $style . '">';
     $layouts = array("all" => Mage::helper('ves_tempcp')->__("All Pages"), "home" => Mage::helper('ves_tempcp')->__("Home"));
     if ($options) {
         foreach ($options as $option) {
             $layouts[$option] = Mage::helper('ves_tempcp')->__($option);
         }
     }
     if (!empty($layouts)) {
         foreach ($layouts as $key => $val) {
             if ($key == $this->value || is_array($this->value) && in_array($key, $this->value)) {
                 $html .= '<option value="' . $key . '" selected="selected">' . $val . '</option>';
             } else {
                 $html .= '<option value="' . $key . '">' . $val . '</option>';
             }
         }
     }
     $html .= '</select>';
     return parent::getElement($value, $group, $html);
 }
开发者ID:quanghuynt93,项目名称:VesSmartshop,代码行数:43,代码来源:layout.php


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