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


PHP FormHelper::getInstance方法代码示例

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


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

示例1: __printFormNew

 public static function __printFormNew($shema)
 {
     $html = '<div style="border-radius: 2px;border: 1px solid #B9B9B9;"><div style="background: #F9F9F9;padding :4px;">';
     $html .= FormHelper::getInstance()->file($shema["Field"], array("id" => $shema["Field"]));
     $html .= '</div></div>';
     return $html;
 }
开发者ID:fozeek,项目名称:application,代码行数:7,代码来源:imageobject.class.php

示例2: __printFormNew

 public static function __printFormNew($shema)
 {
     $string = array();
     $class = array();
     if ($shema["Field"] == "text") {
         $class = array("class" => "text-editable");
     }
     foreach (Kernel::getLangs() as $lang) {
         $typeInput = array_key_exists("size", $shema["Link"]) && $shema["Link"]["size"] == "small" ? "input" : "textarea";
         array_push($string, FormHelper::getInstance()->{$typeInput}($shema["Field"] . "[" . $lang . "]", $class));
     }
     return $string;
 }
开发者ID:fozeek,项目名称:application,代码行数:13,代码来源:langobject.class.php

示例3: getFormNewElements

 public function getFormNewElements($table, array $options = array())
 {
     $form = array();
     foreach ($table->getShema() as $key => $shema) {
         if (!in_array($key, array("id", "deleted", "slug", "date")) && (!is_array($shema["Link"]) || is_array($shema["Link"]) && !array_key_exists("editable", $shema["Link"]))) {
             if (!is_array($shema["Link"]) || !array_key_exists("link", $shema["Link"])) {
                 $params = array("value" => "");
                 if ($key == "password") {
                     $form[$key] = FormHelper::getInstance()->input($key, array("type" => "password"));
                 } elseif ($key == "text") {
                     $form[$key] = FormHelper::getInstance()->textarea($key, $params);
                 } else {
                     $formType = $shema["Link"]["size"] == "small" ? "input" : "textarea";
                     $form[$key] = FormHelper::getInstance()->{$formType}($key, $params);
                 }
             } elseif (array_key_exists("link", $shema["Link"]) && ($shema["Link"]["link"] == "OneToOne" || $shema["Link"]["link"] == "ManyToOne")) {
                 $classOfKey = ucfirst($shema["Link"]["reference"]) . "Object";
                 if (class_exists($classOfKey) && property_exists($classOfKey, "isType")) {
                     if (is_array($inputs = $classOfKey::__printFormNew($shema))) {
                         $form[$key] = "";
                         foreach ($inputs as $input) {
                             $form[$key] .= $input;
                         }
                     } else {
                         $form[$key] = $inputs;
                     }
                 } else {
                     $collection = array();
                     foreach ($this->_form[$key] as $value) {
                         array_push($collection, array("key" => $value->get("id"), "value" => $value->get("title")));
                     }
                     $form[$key] = FormHelper::getInstance()->select($key, $collection);
                 }
             }
             /*elseif($shema["Link"]["link"]=="OneToMany" || $shema["Link"]["link"]=="ManyToMany") {
             			$collection = array();
             			foreach ($this->_form[$key] as $value)
             					array_push($collection, array("key" => $value->get("id"), "value" => $value->get("title")));
             			$form[$key] = FormHelper::getInstance()->select($key."[]", $collection, array("style" => "width: 100%;height: 150px;", "multiple" => true, "class" => "select-multiple"));		
             		}*/
         }
     }
     return $form;
 }
开发者ID:fozeek,项目名称:framework,代码行数:44,代码来源:FormHlepr.php


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