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


PHP StringUtils::IsNullOrEmpty方法代码示例

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


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

示例1: SetValue

 public function SetValue($value)
 {
     if (!StringUtils::IsNullOrEmpty($value)) {
         $this->value = SMDateTime::Parse($value, $this->format);
     } else {
         $this->value = null;
     }
 }
开发者ID:martinw0102,项目名称:ProjetSyst,代码行数:8,代码来源:datetime.php

示例2: SetTimeZoneIfNeed

 public static function SetTimeZoneIfNeed($timezoneIdentifier)
 {
     if (SystemUtils::GetPHPMinorVersion() >= 3) {
         if (StringUtils::IsNullOrEmpty(ini_get('date.timezone'))) {
             date_default_timezone_set($timezoneIdentifier);
         }
     }
 }
开发者ID:martinw0102,项目名称:ProjetSyst,代码行数:8,代码来源:system_utils.php

示例3: GetStyleString

 public function GetStyleString()
 {
     $result = '';
     foreach ($this->styles as $paramName => $paramValue) {
         StringUtils::AddStr($result, "{$paramName}: {$paramValue};", ' ');
     }
     foreach ($this->styleStrings as $styleString) {
         if (!StringUtils::IsNullOrEmpty($styleString) && !StringUtils::EndsBy($styleString, ';')) {
             $styleString .= ';';
         }
         StringUtils::AddStr($result, $styleString, ' ');
     }
     return $result;
 }
开发者ID:martinw0102,项目名称:ProjetSyst,代码行数:14,代码来源:html_utils.php

示例4: Render

 /**
  * @param Renderer $renderer
  * @return void
  */
 public function Render(Renderer $renderer)
 {
     /** @var string $term */
     $term = '';
     if ($this->GetSuperGlobals()->IsGetValueSet('term')) {
         $term = $this->GetSuperGlobals()->GetGetValue('term');
     }
     if (!StringUtils::IsNullOrEmpty($term)) {
         $this->dataset->AddFieldFilter($this->valueField, new FieldFilter('%' . $term . '%', 'ILIKE', true));
     }
     $id = null;
     if ($this->GetSuperGlobals()->IsGetValueSet('id')) {
         $id = $this->GetSuperGlobals()->GetGetValue('id');
     }
     if (!StringUtils::IsNullOrEmpty($id)) {
         $this->dataset->AddFieldFilter($this->idField, FieldFilter::Equals($id));
     }
     header('Content-Type: text/html; charset=utf-8');
     $this->dataset->Open();
     $result = array();
     $valueCount = 0;
     while ($this->dataset->Next()) {
         $result[] = array("id" => $this->dataset->GetFieldValueByName($this->idField), "value" => StringUtils::IsNullOrEmpty($this->captionTemplate) ? $this->dataset->GetFieldValueByName($this->valueField) : DatasetUtils::FormatDatasetFieldsTemplate($this->dataset, $this->captionTemplate));
         if (++$valueCount >= 20) {
             break;
         }
     }
     echo SystemUtils::ToJSON($result);
     $this->dataset->Close();
 }
开发者ID:martinw0102,项目名称:ProjetSyst,代码行数:34,代码来源:common.php

示例5: HasAlias

 public function HasAlias()
 {
     return !StringUtils::IsNullOrEmpty($this->alias);
 }
开发者ID:outsourcinggithub,项目名称:outsourcing,代码行数:4,代码来源:select_command.php

示例6: ApplyHighlight

 public function ApplyHighlight($value, $currentFieldName, $displayFieldName, $term)
 {
     if ($currentFieldName == $displayFieldName && !StringUtils::IsNullOrEmpty($term)) {
         $patterns = array();
         $patterns[0] = '/(' . preg_quote($term) . ')/i';
         $replacements = array();
         $replacements[0] = '<em class="highlight_autocomplete">' . '$1' . '</em>';
         return preg_replace($patterns, $replacements, $value);
     } else {
         return $value;
     }
 }
开发者ID:howareyoucolin,项目名称:demo,代码行数:12,代码来源:advanced_search_page.php

示例7: GetInputAttributes

 /**
  * @return string
  */
 public function GetInputAttributes($suppressRequiredValidation = false)
 {
     $result = '';
     $validationAttr = '';
     foreach ($this->list as $validator) {
         if ($suppressRequiredValidation && SMReflection::ClassName($validator) == 'RequiredValidator') {
             continue;
         }
         StringUtils::AddStr($validationAttr, $validator->GetValidatorName(), ' ');
         StringUtils::AddStr($result, $validator->GetAdditionalAttributes(), ' ');
     }
     if (!StringUtils::IsNullOrEmpty($validationAttr)) {
         StringUtils::AddStr($result, StringUtils::Format('data-validation="%s"', $validationAttr), ' ');
     }
     return $result;
 }
开发者ID:howareyoucolin,项目名称:demo,代码行数:19,代码来源:validators.php

示例8: SetDatasetFieldValue

 public static function SetDatasetFieldValue(Dataset $dataSet, $fieldName, $value)
 {
     if (!StringUtils::IsNullOrEmpty($fieldName)) {
         $dataSet->SetFieldValueByName($fieldName, $value);
     }
 }
开发者ID:howareyoucolin,项目名称:demo,代码行数:6,代码来源:dataset_utils.php

示例9: GetDisplayValueFromDataset

 private function GetDisplayValueFromDataset()
 {
     if (!StringUtils::IsNullOrEmpty($this->captionTemplate)) {
         $this->lookupDataset->AddFieldFilter($this->lookupIdFieldName, new FieldFilter($this->GetDataset()->GetFieldValueByName($this->GetFieldName()), '='));
         $this->lookupDataset->Open();
         if ($this->lookupDataset->Next()) {
             $displayValue = DatasetUtils::FormatDatasetFieldsTemplate($this->lookupDataset, $this->captionTemplate);
             return $displayValue;
         }
         $this->lookupDataset->Close();
     }
     return $this->GetDataset()->GetFieldValueByName($this->displayFieldName);
 }
开发者ID:martinw0102,项目名称:ProjetSyst,代码行数:13,代码来源:edit_columns.php

示例10: UpdateSearchControls

 public function UpdateSearchControls()
 {
     /** @var AdvancedSearchControl $advancedSearch  */
     $advancedSearch = $this->GetPage()->AdvancedSearchControl;
     if ($advancedSearch != null) {
         foreach ($advancedSearch->GetSearchColumns() as $searchColumn) {
             $columnName = $searchColumn->GetFieldName();
             $column = $this->FindViewColumnByName($columnName);
             /** @var Field $field */
             if (!StringUtils::IsNullOrEmpty($column)) {
                 $field = $this->dataset->GetFieldByName($column->GetName());
             } else {
                 $field = $this->dataset->GetFieldByName($columnName);
             }
             if ($field && $searchColumn) {
                 if ($searchColumn instanceof LookupSearchColumn) {
                     $this->filterBuilder->AddField($searchColumn, $searchColumn->GetFieldName(), $searchColumn->GetCaption(), $field->GetEngFieldType(), 'Typeahead', array('handler' => $searchColumn->GetHandlerName()));
                     $searchColumnViewData['Value'] = $searchColumn->GetDisplayValue();
                 } else {
                     if ($field instanceof DateTimeField || $field instanceof DateField) {
                         $formatOptions = array('fdow' => GetFirstDayOfWeek());
                         if (!StringUtils::IsNullOrEmpty($column) && $column instanceof DateTimeViewColumn) {
                             $formatOptions['format'] = $column->GetOSDateTimeFormat();
                         }
                         $this->filterBuilder->AddField($searchColumn, $searchColumn->GetFieldName(), $searchColumn->GetCaption(), $field->GetEngFieldType(), null, $formatOptions);
                     } else {
                         $this->filterBuilder->AddField($searchColumn, $searchColumn->GetFieldName(), $searchColumn->GetCaption(), $field->GetEngFieldType(), null, null);
                     }
                 }
             }
         }
     }
 }
开发者ID:martinw0102,项目名称:ProjetSyst,代码行数:33,代码来源:grid.php

示例11: GetNameInContext

 private function GetNameInContext($name)
 {
     return StringUtils::IsNullOrEmpty($this->context) ? $name : $this->context . '_' . $name;
 }
开发者ID:martinw0102,项目名称:ProjetSyst,代码行数:4,代码来源:superglobal_wrapper.php

示例12: Render

 public function Render(Renderer $renderer)
 {
     $result = array();
     $this->dataset->AddFieldFilter($this->captionFieldName, FieldFilter::Contains($this->arrayWrapper->GetValue(self::SearchTermParamName)));
     if (!StringUtils::IsNullOrEmpty($this->parentIdFieldName) && $this->arrayWrapper->IsValueSet(self::ParentParamName)) {
         $this->dataset->AddFieldFilter($this->parentIdFieldName, FieldFilter::Equals($this->arrayWrapper->GetValue(self::ParentParamName)));
     }
     $this->dataset->Open();
     $valueCount = 0;
     while ($this->dataset->Next()) {
         $result[] = array('id' => $this->dataset->GetFieldValueByName($this->idFieldName), 'value' => $this->dataset->GetFieldValueByName($this->captionFieldName));
         if (++$valueCount >= 20) {
             break;
         }
     }
     $this->dataset->Close();
     echo SystemUtils::ToJSON($result);
 }
开发者ID:outsourcinggithub,项目名称:outsourcing,代码行数:18,代码来源:multilevel_selection.php

示例13: getActualParamName

 private function getActualParamName($paramName)
 {
     return StringUtils::IsNullOrEmpty($this->prefix) ? $paramName : $this->prefix . '_' . $paramName;
 }
开发者ID:CivicInfoBC,项目名称:workplan.gov_ver_1.19,代码行数:4,代码来源:array_wrapper.php

示例14: SetValue

 public function SetValue($value)
 {
     if (!StringUtils::IsNullOrEmpty($value)) {
         $this->value = SMDateTime::Parse($value, $this->showsTime ? 'Y-m-d H:i:s' : 'Y-m-d');
     } else {
         $this->value = null;
     }
 }
开发者ID:howareyoucolin,项目名称:demo,代码行数:8,代码来源:editors.php


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