本文整理汇总了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);
}
示例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);
}
}
示例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'));
}
示例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));
}