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


PHP WireData类代码示例

本文整理汇总了PHP中WireData的典型用法代码示例。如果您正苦于以下问题:PHP WireData类的具体用法?PHP WireData怎么用?PHP WireData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getItemPropertyValue

 /**
  * Get the value of $property from $item
  *
  * Used by the WireArray::sort method to retrieve a value from a Wire object. 
  * If output formatting is on, we turn it off to ensure that the sorting
  * is performed without output formatting.
  *
  * @param Wire $item
  * @param string $property
  * @return mixed
  *
  */
 protected function getItemPropertyValue(Wire $item, $property)
 {
     if ($item instanceof Page) {
         $value = $item->getUnformatted($property);
     } else {
         if (strpos($property, '.') !== false) {
             $value = WireData::_getDot($property, $item);
         } else {
             if ($item instanceof WireArray) {
                 $value = $item->getProperty($property);
                 if (is_null($value)) {
                     $value = $item->first();
                     $value = $this->getItemPropertyValue($value, $property);
                 }
             } else {
                 $value = $item->{$property};
             }
         }
     }
     if (is_array($value)) {
         $value = implode('|', $value);
     }
     return $value;
 }
开发者ID:avatar382,项目名称:fablab_site,代码行数:36,代码来源:PageArray.php

示例2: get

 public function get($key)
 {
     if ($key == 'operator') {
         return $this->getOperator();
     }
     return parent::get($key);
 }
开发者ID:nicolasleon,项目名称:P21,代码行数:7,代码来源:Selector.php

示例3: get

 public function get($key)
 {
     if ($key == 'className' || $key == 'class' || $key == 'name') {
         return $this->class;
     }
     return parent::get($key);
 }
开发者ID:avatar382,项目名称:fablab_site,代码行数:7,代码来源:ModulePlaceholder.php

示例4: get

 public function get($key)
 {
     if ($key == 'statusString') {
         return str_replace('_', ' ', $this->geocodeStatuses[$this->status]);
     }
     return parent::get($key);
 }
开发者ID:ranzwertig,项目名称:FieldtypeMapMarker,代码行数:7,代码来源:MapMarker.php

示例5: get

 /**
  * Get a value stored in this Process
  *
  */
 public function get($key)
 {
     if (($value = $this->getFuel($key)) !== null) {
         return $value;
     }
     return parent::get($key);
 }
开发者ID:rzelnik,项目名称:ProcessWire,代码行数:11,代码来源:Process.php

示例6: set

 public function set($key, $value)
 {
     if ($key == 'fieldChanges') {
         // convert string changes list of field names to array
         if (is_array($value)) {
             if (!trim(implode('', $value))) {
                 $value = array();
             }
         } else {
             $value = explode(' ', $value);
         }
         // sanitize
         foreach ($value as $k => $v) {
             $required = strpos($v, '+') === 0;
             if ($required) {
                 $v = ltrim($v, '+');
             }
             $v = $this->wire('sanitizer')->fieldName($v);
             if (empty($v)) {
                 continue;
             }
             $value[$k] = ($required ? '+' : '') . $v;
         }
     }
     return parent::set($key, $value);
 }
开发者ID:arjenblokzijl,项目名称:IftRunner,代码行数:26,代码来源:IftTrigger.php

示例7: __get

 public function __get($key)
 {
     if ($key == 'query') {
         return $this->getQuery();
     } else {
         return parent::__get($key);
     }
 }
开发者ID:posixpascal,项目名称:TrooperCMS,代码行数:8,代码来源:DatabaseQuery.php

示例8: __set

 public function __set($key, $value)
 {
     if (array_key_exists($key, $this->mail)) {
         $this->{$key}($value);
     } else {
         parent::__set($key, $value);
     }
 }
开发者ID:Rizsti,项目名称:Processwire_Compatibility,代码行数:8,代码来源:WireMail.php

示例9: set

 public function set($key, $value)
 {
     if ($key == 'id' || $key == 'modules_id') {
         $value = (int) $value;
     } else {
         if ($key == 'name') {
             $value = $this->fuel('sanitizer')->name($value);
         }
     }
     return parent::set($key, $value);
 }
开发者ID:ryancramerdesign,项目名称:ProcessWire-2.0,代码行数:11,代码来源:Permission.php

示例10: get

 /**
  * Retrieve a value from the ImageMarker: date, location or notes
  *
  */
 public function get($key)
 {
     $value = parent::get($key);
     // if the page's output formatting is on, then we'll return formatted values
     if ($this->page && $this->page->of()) {
         // int sanitizer
         if ($key == 'info' || $key == 'x' || $key == 'y') {
             $value = (int) $value;
         }
     }
     return $value;
 }
开发者ID:kongondo,项目名称:FieldtypeImageMarker,代码行数:16,代码来源:ImageMarker.php

示例11: get

 /**
  * Return the requested path variable
  *
  */
 public function get($key)
 {
     $value = parent::get($key);
     if ($key == 'root') {
         return $value;
     }
     if (!is_null($value)) {
         if ($value[0] == '/' || DIRECTORY_SEPARATOR != '/' && $value[1] == ':') {
             return $value;
         } else {
             $value = $this->root . $value;
         }
     }
     return $value;
 }
开发者ID:ryancramerdesign,项目名称:ProcessWire-2.0,代码行数:19,代码来源:Paths.php

示例12: __construct

 public function __construct()
 {
     if ($this->wire('input')->get('test_notices')) {
         $this->message('Message test');
         $this->message('Message test debug', Notice::debug);
         $this->message('Message test markup <a href="#">example</a>', Notice::allowMarkup);
         $this->warning('Warning test');
         $this->warning('Warning test debug', Notice::debug);
         $this->warning('Warning test markup <a href="#">example</a>', Notice::allowMarkup);
         $this->error('Error test');
         $this->error('Error test debug', Notice::debug);
         $this->error('Error test markup <a href="#">example</a>', Notice::allowMarkup);
     }
     parent::__construct();
 }
开发者ID:Rizsti,项目名称:Processwire_Compatibility,代码行数:15,代码来源:AdminThemeDefaultHelpers.php

示例13: _

 /**
  * Perform a translation, based on text from shared admin file: /wire/templates-admin/default.php
  * 
  * @param string $text
  * @return string
  * 
  */
 public function _($text)
 {
     static $translate = null;
     if (is_null($translate)) {
         $translate = $this->wire('languages') !== null;
     }
     if ($translate === false) {
         return $text;
     }
     $value = __($text, $this->wire('config')->paths->root . 'wire/templates-admin/default.php');
     if ($value === $text) {
         $value = parent::_($text);
     }
     return $value;
 }
开发者ID:posixpascal,项目名称:TrooperCMS,代码行数:22,代码来源:AdminThemeDefaultHelpers.php

示例14: js

 /**
  * Set a config field that is shared in Javascript, OR retrieve one or all params already set
  *
  * Specify only a $key and omit the $value in order to retrieve an existing set value.
  * Specify no params to retrieve in array of all existing set values.
  *
  * @param string $key 
  * @param mixed $value
  *
  */
 public function js($key = null, $value = null)
 {
     if (is_null($key)) {
         $data = array();
         foreach ($this->jsFields as $field) {
             $data[$field] = $this->get($field);
         }
         return $data;
     } else {
         if (is_null($value)) {
             return in_array($key, $this->jsFields) ? $this->get($key) : null;
         }
     }
     $this->jsFields[] = $key;
     return parent::set($key, $value);
 }
开发者ID:ryancramerdesign,项目名称:ProcessWire-2.0,代码行数:26,代码来源:Config.php

示例15: get

 /**
  * Retrieve a value from the event: date, location or notes
  *
  */
 public function get($key)
 {
     $value = parent::get($key);
     // if the page's output formatting is on, then we'll return formatted values
     if ($this->page && $this->page->of()) {
         if ($key == 'date') {
             // format a unix timestamp to a date string
             $value = date(self::dateFormat, $value);
         } else {
             if ($key == 'location' || $key == 'notes') {
                 // return entity encoded versions of strings
                 $value = $this->sanitizer->entities($value);
             }
         }
     }
     return $value;
 }
开发者ID:bensssyde,项目名称:FieldtypeEvents,代码行数:21,代码来源:Event.php


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