當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。