當前位置: 首頁>>代碼示例>>PHP>>正文


PHP field::setDataObjects方法代碼示例

本文整理匯總了PHP中field::setDataObjects方法的典型用法代碼示例。如果您正苦於以下問題:PHP field::setDataObjects方法的具體用法?PHP field::setDataObjects怎麽用?PHP field::setDataObjects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在field的用法示例。


在下文中一共展示了field::setDataObjects方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: IN

     $sortingField .= "<option value='" . $field['title'] . "'>" . $field['title'] . "</option>";
     $dataModule = "";
     $options = "<option value='='>=</option>" . "<option value='>'>></option>" . "<option value='>='>>=</option>" . "<option value='<'><</option>" . "<option value='<='><=</option>" . "<option value='!='>!=</option>" . "<option value='LIKE'>LIKE</option>" . "<option value='LIKEPER'>LIKE %...%</option>" . "<option value='NOTLIKE'>NOT LIKE</option>" . "<option value='IN'>IN(...)</option>" . "<option value='NOTIN'>NOT IN(...)</option>" . "<option value='ISNULL'>IS NULL</option>" . "<option value='ISNOTNULL'>IS NOT NULL</option>";
     if (in_array($field['type'], $dateTypeArray)) {
         $input = "<div class='input-group date date-widget' ><input type='text' class='form-control valueOperation' data-id='" . $field["id"] . "' />" . "<span class='input-group-addon'>\n                        <span class='glyphicon glyphicon-calendar'></span>\n                    </span></div>" . "";
         $options = "<option value='='>=</option>" . "<option value='>'>></option>" . "<option value='>='>>=</option>" . "<option value='<'><</option>" . "<option value='<='><=</option>" . "<option value='!='>!=</option>" . "<option value='ISNULL'>IS NULL</option>" . "<option value='ISNOTNULL'>IS NOT NULL</option>";
     } elseif ($field['type'] == "DynamicSelect") {
         $field_ob = new field();
         $field_ob->SetIdField();
         $field_ob->SetNameField();
         $field_ob->SetCssClass("valueOperation form-control");
         $field_ob->SetTypeField($field['type']);
         $plus = explode(',', $field['plus']);
         $field_ob->SetExtra($plus);
         $field_ob->setWithObjectsExtra(true);
         $field_ob->setDataObjects(array("id" => $field["id"]));
         $res = $field_ob->getField();
         $dataModule = "data-module='" . $plus[0] . "'";
         $input = "<div class='input-group' style='width:100%' >{$res}</div>";
         $options = "<option value='='>=</option>" . "<option value='!='>!=</option>" . "<option value='IN'>IN(...)</option>" . "<option value='NOTIN'>NOT IN(...)</option>" . "<option value='ISNULL'>IS NULL</option>" . "<option value='ISNOTNULL'>IS NOT NULL</option>";
     } else {
         $input = "<div class='input-group' style='width:100%' ><input type='text' class='form-control valueOperation' data-id='" . $field["id"] . "' ></div>";
     }
     $operations .= "<tr>" . "<td><label>" . $utils->getConstant($field["title"]) . "</label></td>" . "<td><select data-field='" . $field["title"] . "' {$dataModule} data-type='" . $field['type'] . "' class='operation form-control' style='min-width:150px;' data-id='" . $field["id"] . "'>" . $options . "</select></td>" . "<td>{$input}</td>" . "</tr>";
 }
 $operations .= "</tbody></table></div><div class='col-sm-6'><table class='table table-striped table-bordered table-hover' style='margin-top:10px'><tbody><tr><tr><td colspan='3' class='danger'><label>" . $utils->getConstant("sorting") . "</label></td></tr>";
 $operations .= "" . "<td><label>" . $utils->getConstant("OrderBy") . "</label></td>" . "<td colspan='2'><select class='form-control' id='WidgetSortBy'><option value=''>---------------------</option><option value='id'>id</option>{$sortingField}</select></td>" . "</tr>";
 $operations .= "<tr>" . "<td><label>" . $utils->getConstant("OrderType") . "</label></td>" . "<td colspan='2'><select class='form-control' id='WidgetOrderBy'><option value=''>---------------------</option><option value='asc'>" . $utils->getConstant("asc") . "</option><option value='desc'>" . $utils->getConstant("desc") . "</option></select></td>" . "</tr>";
 $operations .= "<tr>" . "<td><label>" . $utils->getConstant("Limit") . "</label></td>" . "<td colspan='2'><input class='form-control' id='WidgetLimit'></td>" . "</tr>";
 $operations .= "</tbody></table></div></div>";
 echo $operations;
開發者ID:VoilaVoila,項目名稱:voilacms,代碼行數:31,代碼來源:getOperationForWidgetForPageBuilder.php


注:本文中的field::setDataObjects方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。