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


PHP ElggObject::getIconURL方法代码示例

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


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

示例1: getIconURL

 /**
  * Get Icon URL
  * @param str $size
  * @return str
  */
 public function getIconURL($size = 'medium')
 {
     if ($this->icontime) {
         return elgg_get_config('url') . "framework/icon/{$this->guid}/{$size}/{$this->icontime}.jpg";
     }
     return parent::getIconURL($size);
 }
开发者ID:amcfarlane1251,项目名称:ongarde,代码行数:12,代码来源:hjObject.php

示例2: getIconURL

 /**
  * Returns icon url for the application
  * 
  * @param string $size icon size
  * 
  * @return string
  * 
  * @see ElggEntity::getIconURL()
  */
 function getIconURL($size = "medium")
 {
     if (isset($this->icon_url)) {
         return $this->icon_url;
     } else {
         return parent::getIconURL($size);
     }
 }
开发者ID:lorea,项目名称:Hydra-dev,代码行数:17,代码来源:APIApplication.php

示例3: testElggEntityGetIconURL

 public function testElggEntityGetIconURL()
 {
     elgg_register_plugin_hook_handler('entity:icon:url', 'object', function ($hook, $type, $url, $params) {
         $size = (string) elgg_extract('size', $params);
         return "{$size}.jpg";
     }, 99999);
     $obj = new \ElggObject();
     $obj->save();
     // Test default size
     $this->assertEqual($obj->getIconURL(), elgg_normalize_url('medium.jpg'));
     // Test size
     $this->assertEqual($obj->getIconURL('small'), elgg_normalize_url('small.jpg'));
     // Test mixed params
     $this->assertEqual($obj->getIconURL('small'), $obj->getIconURL(array('size' => 'small')));
     // Test bad param
     $this->assertEqual($obj->getIconURL(new \stdClass()), elgg_normalize_url('medium.jpg'));
 }
开发者ID:Twizanex,项目名称:GuildWoW,代码行数:17,代码来源:ElggEntityTest.php

示例4: parseEvent

 /**
  * @SWG\Definition(
  *  definition="Event",
  *  required={"guid","title"},
  *  @SWG\Property(property="guid", type="integer"),
  *  @SWG\Property(property="title", type="string"),
  *  @SWG\Property(property="description", type="string"),
  *  @SWG\Property(property="start_time", type="string"),
  *  @SWG\Property(property="end_time", type="string"),
  *  @SWG\Property(property="url", type="string"),
  *  @SWG\Property(property="icon_url", type="string"),
  *  @SWG\Property(property="time_created", type="string")
  * )
  */
 private function parseEvent(\ElggObject $event)
 {
     $start_time = mktime(date("H", $event->start_time), date("i", $event->start_time), 0, date("n", $event->start_day), date("j", $event->start_day), date("Y", $event->start_day));
     if ($event->end_ts) {
         $end_time = date('c', $event->end_ts);
     } else {
         $end_time = null;
     }
     return array('guid' => $event->guid, 'title' => html_entity_decode($event->title, ENT_QUOTES), 'description' => html_entity_decode($event->description, ENT_QUOTES), 'start_time' => date('c', $start_time), 'end_time' => $end_time, 'url' => $event->getURL(), 'icon_url' => $event->getIconURL(), 'time_created' => date('c', $event->time_created));
 }
开发者ID:Pleio,项目名称:pleio_rest,代码行数:24,代码来源:Events.php


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