本文整理汇总了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;
}
示例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;
}
示例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;
}