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


PHP EEM_Base::field_settings_for方法代码示例

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


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

示例1: _prepare_value_from_db_for_display

 /**
  * Shortcut for preparing a database result for display
  * @param EEM_Base $model
  * @param string $field_name
  * @param string $raw_db_value
  * @param boolean|string $pretty_schema true to display pretty, a string to use a specific "Schema", or false to NOT display pretty
  * @return string
  */
 protected function _prepare_value_from_db_for_display($model, $field_name, $raw_db_value, $pretty_schema = true)
 {
     $field_obj = $model->field_settings_for($field_name);
     $value_on_model_obj = $field_obj->prepare_for_set_from_db($raw_db_value);
     if ($field_obj instanceof EE_Datetime_Field) {
         $field_obj->set_date_format(EE_CSV::instance()->get_date_format_for_csv($field_obj->get_date_format($pretty_schema)), $pretty_schema);
         $field_obj->set_time_format(EE_CSV::instance()->get_time_format_for_csv($field_obj->get_time_format($pretty_schema)), $pretty_schema);
     }
     if ($pretty_schema === true) {
         return $field_obj->prepare_for_pretty_echoing($value_on_model_obj);
     } elseif (is_string($pretty_schema)) {
         return $field_obj->prepare_for_pretty_echoing($value_on_model_obj, $pretty_schema);
     } else {
         return $field_obj->prepare_for_get($value_on_model_obj);
     }
 }
开发者ID:aaronfrey,项目名称:PepperLillie-GSP,代码行数:24,代码来源:EE_Export.class.php

示例2: _prepare_value_from_db_for_display

 /**
  * Shortcut for preparing a database result for display
  * @param EEM_Base $model
  * @param string $field_name
  * @param string $raw_db_value
  * @param boolean|string $pretty_schema true to display pretty, a string to use a specific "Schema", or false to NOT display pretty
  * @return string
  */
 protected function _prepare_value_from_db_for_display($model, $field_name, $raw_db_value, $pretty_schema = true)
 {
     $field_obj = $model->field_settings_for($field_name);
     $value_on_model_obj = $field_obj->prepare_for_set_from_db($raw_db_value);
     if ($pretty_schema === true) {
         return $field_obj->prepare_for_pretty_echoing($value_on_model_obj);
     } elseif (is_string($pretty_schema)) {
         return $field_obj->prepare_for_pretty_echoing($value_on_model_obj, $pretty_schema);
     } else {
         return $field_obj->prepare_for_get($value_on_model_obj);
     }
 }
开发者ID:robert-osborne,项目名称:event-espresso-core-1,代码行数:20,代码来源:EE_Export.class.php


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