本文整理汇总了PHP中HTML::image方法的典型用法代码示例。如果您正苦于以下问题:PHP HTML::image方法的具体用法?PHP HTML::image怎么用?PHP HTML::image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML
的用法示例。
在下文中一共展示了HTML::image方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
$foursquare = $this->venue->foursquare();
if (!$foursquare) {
echo new View_Alert(__('This venue has not been linked to Foursquare yet.'), null, View_Alert::INFO);
} else {
// Homepage
echo HTML::anchor(Arr::path($foursquare, 'short_url'), HTML::image(Arr::path($foursquare, 'primarycategory.iconurl'), array('alt' => HTML::chars(Arr::path($foursquare, 'primarycategory.nodename')), 'title' => HTML::chars(Arr::path($foursquare, 'primarycategory.nodename')))) . ' ' . HTML::chars(Arr::path($foursquare, 'primarycategory.nodename'))), '<br />';
// Mayor
if ($mayor = Arr::path($foursquare, 'stats.mayor.user')) {
echo __('Mayor: :mayor, :city', array(':mayor' => HTML::anchor('http://foursquare.com/user/' . Arr::get($mayor, 'id'), HTML::chars(Arr::get($mayor, 'firstname')) . ' ' . HTML::chars(Arr::get($mayor, 'lastname'))), ':city' => HTML::chars($mayor['homecity']))), '<br />';
}
// Checkins
echo __('Check-ins: :checkins', array(':checkins' => '<var>' . Arr::path($foursquare, 'stats.checkins') . '</var>')), '<br />';
// Here now
echo __('Here now: :herenow', array(':herenow' => '<var>' . Arr::path($foursquare, 'stats.herenow') . '</var>')), '<br />';
// Tips
if ($tips = Arr::path($foursquare, 'tips')) {
echo '<h5>', __('Tips (:tips)', array(':tips' => '<var>' . count($tips) . '</var>')), '</h5><dl>';
foreach (array_slice($tips, 0, 5) as $tip) {
echo '<dt>', HTML::anchor('http://foursquare.com/user/' . Arr::path($tip, 'user.id'), HTML::chars(Arr::path($tip, 'user.firstname')) . ' ' . HTML::chars(Arr::path($tip, 'user.lastname'))), ', ', HTML::chars(Arr::path($tip, 'user.homecity')), ':</dt>';
echo '<dd>', Text::auto_p(HTML::chars(Arr::path($tip, 'text'))), '</dd>';
}
echo '</dl>';
}
}
// Admin controls
if (Permission::has($this->venue, Model_Venue::PERMISSION_UPDATE)) {
echo HTML::anchor('#map', __('Link to Foursquare'), array('class' => 'action', 'id' => 'link-foursquare'));
echo $this->form();
}
return ob_get_clean();
}
示例2: content
/**
* Render content.
*
* @return string
*/
public function content()
{
ob_start();
// Stamp
echo HTML::time(Date('l ', $this->event->stamp_begin) . Date::format('DDMMYYYY', $this->event->stamp_begin), $this->event->stamp_begin, true);
// Location
if ($this->event->venue) {
echo ' @ ', HTML::anchor(Route::model($this->event->venue), HTML::chars($this->event->venue->name)), ', ', HTML::chars($this->event->venue->city_name);
} elseif ($this->event->venue_name) {
echo ' @ ', $this->event->venue_url ? HTML::anchor($this->event->venue_url, $this->event->venue_name) : HTML::chars($this->event->venue_name), $this->event->city_name ? ', ' . HTML::chars($this->event->city_name) : '';
} elseif ($this->event->city_name) {
echo ' @ ', HTML::chars($this->event->city_name);
}
// Flyer
if ($this->event->flyer_front) {
echo '<figure>', HTML::image($this->event->flyer_front->get_url(Model_Image::SIZE_THUMBNAIL)), '</figure>';
} elseif ($this->event->flyer_back) {
echo '<figure>', HTML::image($this->event->flyer_back->get_url(Model_Image::SIZE_THUMBNAIL)), '</figure>';
} elseif (Valid::url($this->event->flyer_front_url)) {
echo '<br /><figure>', HTML::image($this->event->flyer_front_url, array('width' => 160)), '</figure>';
}
// Favorites
if ($this->event->favorite_count) {
echo '<span class="stats"><i class="icon-heart"></i> ' . $this->event->favorite_count . '</span>';
}
return ob_get_clean();
}
示例3: content
/**
* Render content.
*
* @return string
*/
public function content()
{
ob_start();
// Stamp
echo HTML::time(Date('l ', $this->event->stamp_begin) . Date::format('DDMMYYYY', $this->event->stamp_begin), $this->event->stamp_begin, true);
// Location
if ($this->event->venue) {
echo ' @ ', HTML::anchor(Route::model($this->event->venue), HTML::chars($this->event->venue->name)), ', ', HTML::chars($this->event->venue->city_name);
} elseif ($this->event->venue_name) {
echo ' @ ', $this->event->venue_url ? HTML::anchor($this->event->venue_url, $this->event->venue_name) : HTML::chars($this->event->venue_name), $this->event->city_name ? ', ' . HTML::chars($this->event->city_name) : '';
} elseif ($this->event->city_name) {
echo ' @ ', HTML::chars($this->event->city_name);
}
// Flyer
if ($flyer = $this->event->flyer()) {
echo '<figure>', HTML::image($flyer->image_url(Model_Image::SIZE_THUMBNAIL)), '</figure>';
} elseif ($this->event->flyer_front_url) {
echo '<figure>', HTML::image($this->event->flyer_front_url, ['class' => 'img-responsive']), '</figure>';
}
// Favorites
if ($this->event->favorite_count) {
echo '<span class="stats"><i class="fa fa-heart"></i> ' . $this->event->favorite_count . '</span>';
}
return ob_get_clean();
}
示例4: content
/**
* Render content.
*
* @return string
*/
public function content()
{
ob_start();
// Cover
if (Valid::url($this->track->cover)) {
echo HTML::image($this->track->cover, array('class' => 'cover img-responsive', 'alt' => __('Cover')));
}
// Time
if ($this->track->size_time) {
echo '<i class="fa fa-fw fa-clock-o"></i> ' . $this->track->size_time . '<br />';
}
// Listen count
if ($this->track->listen_count > 1) {
echo '<i class="fa fa-fw fa-play"></i> ' . ($this->track->listen_count == 1 ? __(':count play', array(':count' => $this->track->listen_count)) : __(':count plays', array(':count' => $this->track->listen_count))) . '<br />';
}
// Tags
if ($tags = $this->track->tags()) {
echo '<i class="fa fa-fw fa-music"></i> ' . implode(', ', $tags) . '<br />';
} elseif (!empty($this->track->music)) {
echo '<i class="fa fa-fw fa-music"></i> ' . $this->track->music . '<br />';
}
// Meta
echo '<footer class="meta text-muted">';
echo __('Added :date', array(':date' => HTML::time(Date::format(Date::DMY_SHORT, $this->track->created), $this->track->created)));
echo '</footer>';
return ob_get_clean();
}
示例5: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
echo '<figure>', HTML::image($this->image->get_url(Model_Image::SIZE_THUMBNAIL)), '</figure>';
// Tagged people
$notes = $this->image->notes();
if (count($notes)) {
$names = array();
/** @var Model_Image_Note $note */
foreach ($notes as $note) {
$user = $note->user();
$names[] = $user ? HTML::user($user['username']) : HTML::chars($note->name);
}
echo implode(', ', $names);
}
// Copyright
if ($this->image->author_id) {
echo '<br />© ', HTML::user($this->image->author_id);
}
// Comments
if ($this->image->comment_count) {
echo '<span class="stats"><i class="icon-comment"></i> ' . $this->image->comment_count . '</span>';
}
return ob_get_clean();
}
示例6: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
?>
<ul class="thumbnails">
<?php
foreach ($this->flyers as $flyer) {
$name = $flyer->event ? $flyer->event->name : $flyer->name;
?>
<li class="span2">
<?php
echo HTML::anchor(Route::get('flyer')->uri(array('id' => $flyer->id)), HTML::image($flyer->image->get_url('thumbnail')), array('class' => 'thumbnail'));
?>
<h4><?php
echo HTML::anchor(Route::get('flyer')->uri(array('id' => $flyer->id)), HTML::chars($name), array('title' => HTML::chars($name)));
?>
</h4>
</li>
<?php
}
?>
</ul>
<?php
return ob_get_clean();
}
示例7: star_loop_yellow
public static function star_loop_yellow($stars)
{
for ($x = 0; $x < $stars; $x++) {
$img_path = 'images/star_yellow.png';
echo HTML::image($img_path, '');
}
}
示例8: image
public function image($data, $name, $default = NULL, $attrs = array())
{
$default_attrs = array('property' => $name, 'property-type' => 'image');
$attrs = Arr::merge($default_attrs, $attrs);
$href = $this->get($data, $name, $default);
return HTML::image($href, $attrs);
}
示例9: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
if ($this->image) {
$image = HTML::image(is_string($this->image) ? $this->image : $this->image->get_url(), array('width' => 290));
?>
<div id="slideshow-image">
<?php
echo isset($this->link) && $this->link ? HTML::anchor($this->link, $image) : $image;
?>
</div>
<?php
} else {
?>
<div class="well">
<?php
echo __('No images yet.');
?>
</div>
<?php
}
return ob_get_clean();
}
示例10: input
public function input($name, $value, array $attr = NULL)
{
$input = Form::file($name, $attr);
if ($value) {
$input .= HTML::image($this->verbose($value));
}
return $input;
}
示例11: on_show
/**
* If values is yes/no
* @param string $value
* @return string
*/
public function on_show($value)
{
if (isset($this->item['yesno'])) {
return HTML::image('media/gfx/' . $value . '.png');
} else {
return $value;
}
}
示例12: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
?>
<div class="row">
<?php
foreach ($this->images as $image) {
$gallery = $image->gallery();
?>
<div class="<?php
echo $this->wide ? 'col-xs-6 col-sm-4 col-md-3 col-lg-2' : 'col-xs-12 col-sm-6';
?>
">
<div class="thumbnail">
<?php
echo HTML::anchor(Route::url('gallery_image', array('gallery_id' => Route::model_id($gallery), 'id' => $image->id)), HTML::image($image->get_url('thumbnail', $gallery->dir)));
?>
<div class="caption">
<h4><?php
echo HTML::anchor(Route::model($gallery), HTML::chars($gallery->name));
?>
</h4>
</div>
<small class="stats label label-default">
<?php
switch ($this->type) {
case Model_Image::TOP_COMMENTED:
echo '<i class="fa fa-comment"></i> ', Num::format($image->comment_count, 0);
break;
case Model_Image::TOP_RATED:
echo '<i class="fa fa-star"></i> ', round($image->rate_total / $image->rate_count, 2);
break;
case Model_Image::TOP_VIEWED:
echo '<i class="fa fa-eye"></i> ', Num::format($image->view_count, 0);
break;
}
?>
</small>
</div>
</div>
<?php
}
?>
</div>
<?php
return ob_get_clean();
}
示例13: __construct
public function __construct()
{
parent::__construct();
$editorial = Model_Editorial::getRandom();
$this->template->title = $editorial->title;
$this->template->image = HTML::image($editorial->image, array('alt' => $editorial->image_alt));
$this->template->text = $editorial->text;
$this->template->link = HTML::anchor($editorial->link, $editorial->link_text);
}
示例14: postPracticeLogo
public function postPracticeLogo($practice_id)
{
$practice = Practiceinfo::find($practice_id);
$html = "";
if ($practice->practice_logo != '') {
$html = HTML::image($practice->practice_logo, 'Practice Logo', array('border' => '0'));
}
echo $html;
}
示例15: input
public function input($name, array $attr = array())
{
$attr['type'] = 'file';
$r = Form::input($name, '', $attr);
if ($this->value != '') {
$r .= HTML::image($this->__toString());
}
return $r;
}