本文整理汇总了PHP中Zend\View\Renderer\PhpRenderer::hyperlink方法的典型用法代码示例。如果您正苦于以下问题:PHP PhpRenderer::hyperlink方法的具体用法?PHP PhpRenderer::hyperlink怎么用?PHP PhpRenderer::hyperlink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\View\Renderer\PhpRenderer
的用法示例。
在下文中一共展示了PhpRenderer::hyperlink方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
public function render(PhpRenderer $view, MediaRepresentation $media, array $options = [])
{
$data = $media->mediaData();
if ($data['type'] == 'photo') {
$url = $data['url'];
$width = $data['width'];
$height = $data['height'];
if (!empty($data['title'])) {
$title = $data['title'];
} else {
$title = $url;
}
return sprintf('<img src="%s" width="%s" height="%s" alt="%s">', $view->escapeHtml($url), $view->escapeHtml($width), $view->escapeHtml($height), $view->escapeHtml($title));
} else {
if (!empty($data['html'])) {
return $data['html'];
} else {
$source = $media->source();
if (!$empty($data['title'])) {
$title = $data['title'];
} else {
$title = $source;
}
return $view->hyperlink($title, $source);
}
}
}
示例2: render
public function render(PhpRenderer $view, SitePageBlockRepresentation $block)
{
parse_str($this->getData($block->data(), 'query'), $query);
$previewQuery = $query;
$previewQuery['limit'] = 10;
$previewQuery['site_id'] = $block->page()->site()->id();
$response = $this->getServiceLocator()->get('Omeka\\ApiManager')->search('items', $previewQuery);
$preview = '<ul>';
foreach ($response->getContent() as $item) {
$preview .= '<li>' . $item->displayTitle() . '</li>';
}
$preview .= '</ul>';
$link = $view->hyperlink('browse this', $view->url('site/resource', ['controller' => 'item'], ['query' => $query], true));
return $preview . $link;
}
示例3: render
public function render(PhpRenderer $view, MediaRepresentation $media, array $options = [])
{
return sprintf('<audio src="%s" controls>%s</audio>', $view->escapeHtml($media->originalUrl()), $view->hyperlink($media->filename(), $media->originalUrl()));
}