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


PHP HTML::time方法代码示例

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


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

示例1: content

    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        if (!$this->topics) {
            return '';
        }
        ob_start();
        ?>

<ul class="unstyled">

		<?php 
        foreach ($this->topics as $topic) {
            ?>
		<li>
			<small class="ago"><?php 
            echo HTML::time(Date::short_span($topic->last_posted, true), $topic->last_posted);
            ?>
</small>
			<?php 
            echo HTML::anchor(Route::model($topic), '<i class="muted iconic-upload"></i>', array('title' => __('First post')));
            ?>
			<?php 
            echo HTML::anchor(Route::model($topic, '?page=last#last'), HTML::chars($topic->name), array('title' => $topic->name));
            ?>
		</li>
		<?php 
        }
        ?>

</ul>

<?php 
        return ob_get_clean();
    }
开发者ID:anqh,项目名称:forum,代码行数:39,代码来源:list.php

示例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 ($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();
 }
开发者ID:anqh,项目名称:anqh,代码行数:30,代码来源:hovercard.php

示例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 ($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();
 }
开发者ID:anqh,项目名称:events,代码行数:32,代码来源:hovercard.php

示例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();
 }
开发者ID:anqh,项目名称:anqh,代码行数:32,代码来源:info.php

示例5: content

    /**
     * Render content.
     *
     * @return  string
     */
    public function content()
    {
        $shouts = array();
        foreach (Model_Shout::find_latest($this->limit) as $shout) {
            $shouts[] = array('created' => $shout->created, 'user_id' => $shout->author_id, 'shout' => $shout->shout);
        }
        if ($shouts) {
            ob_start();
            ?>

<ul class="list-unstyled">

	<?php 
            foreach (array_reverse($shouts) as $shout) {
                ?>
	<li>
		<?php 
                echo HTML::time(Date::format('HHMM', $shout['created']), array('datetime' => $shout['created'], 'class' => 'muted'));
                ?>
		<?php 
                echo HTML::user($shout['user_id']);
                ?>
:
		<?php 
                echo Text::smileys(Text::auto_link_urls(HTML::chars($shout['shout'])));
                ?>
	</li>
	<?php 
            }
            ?>

</ul>

<?php 
            if ($this->_can_shout) {
                ?>
<form <?php 
                echo $this->aside ? 'class="ajaxify"' : '';
                ?>
 action="<?php 
                echo Route::url('shouts', array('action' => 'shout'));
                ?>
" method="post">
	<input class="form-control" type="text" name="shout" maxlength="300" placeholder="<?php 
                echo __('Shout, and ye shall be heard..');
                ?>
" />
	<?php 
                echo Form::CSRF();
                ?>
</form>
<?php 
            }
            return ob_get_clean();
        }
        return '';
    }
开发者ID:anqh,项目名称:anqh,代码行数:62,代码来源:shouts.php

示例6: content

    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        // Title
        if ($this->area->description) {
            echo $this->area->description . '<hr>';
        }
        if ($this->area->topic_count) {
            // Area has topics
            $last_topic = $this->area->last_topic();
            $last_poster = $last_topic->last_post()->author();
            ?>

		<div class="media">
			<div class="pull-left">
				<?php 
            echo HTML::avatar($last_poster ? $last_poster['avatar'] : null, $last_poster ? $last_poster['username'] : null, false);
            ?>
			</div>
			<div class="media-body">
				<small class="ago"><?php 
            echo HTML::time(Date::short_span($last_topic->last_posted, true, true), $last_topic->last_posted);
            ?>
</small>
				<?php 
            echo $last_poster ? HTML::user($last_poster) : HTML::chars($last_topic->last_poster);
            ?>
				<br>
				<?php 
            echo HTML::anchor(Route::model($last_topic, '?page=last#last'), Forum::topic($last_topic), array('title' => HTML::chars($last_topic->name)));
            ?>
<br />
			</div>
		</div>

		<small class="stats muted">
			<i class="icon-comments"></i> <?php 
            echo Num::format($this->area->topic_count, 0);
            ?>
			<i class="icon-comment"></i> <?php 
            echo Num::format($this->area->post_count, 0);
            ?>
		</small>

<?php 
        } else {
            // Empty area
            echo __('No topics yet.');
        }
        return ob_get_clean();
    }
开发者ID:anqh,项目名称:anqh,代码行数:56,代码来源:hovercard.php

示例7: content

    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        ?>

<dl>

		<?php 
        echo $this->user->homepage ? '<dt>' . __('Homepage') . '</dt><dd>' . HTML::anchor($this->user->homepage, HTML::chars($this->user->homepage)) . '</dd>' : '';
        ?>
		<?php 
        echo $this->user->gender ? '<dt>' . __('Gender') . '</dt><dd>' . ($this->user->gender == 'm' ? __('Male') : __('Female')) . '</dd>' : '';
        ?>
		<?php 
        echo $this->user->dob ? '<dt>' . __('Date of Birth') . '</dt><dd>' . Date::format('DMYYYY', $this->user->dob) . ' (' . Date::age($this->user->dob) . ')</dd>' : '';
        ?>

		<dt><?php 
        echo __('Registered');
        ?>
</dt><dd><?php 
        echo HTML::time(Date::fuzzy_span($this->user->created), $this->user->created);
        ?>
			(<?php 
        echo __('member #:member', array(':member' => '<var>' . number_format($this->user->id) . '</var>'));
        ?>
)</dd>
		<dt><?php 
        echo __('Updated');
        ?>
</dt><dd><?php 
        echo HTML::time(Date::fuzzy_span($this->user->modified), $this->user->modified);
        ?>
</dd>
		<dt><?php 
        echo __('Last login');
        ?>
</dt><dd><?php 
        echo HTML::time(Date::fuzzy_span($this->user->last_login), $this->user->last_login);
        ?>
			(<?php 
        echo __($this->user->login_count == 1 ? ':logins login' : ':logins logins', array(':logins' => '<var>' . number_format($this->user->login_count) . '</var>'));
        ?>
)</dd>

</dl>

<?php 
        return ob_get_clean();
    }
开发者ID:anqh,项目名称:core,代码行数:55,代码来源:info.php

示例8: content

 /**
  * Render view.
  *
  * @return  string
  */
 public function content()
 {
     ob_start();
     // Title
     if ($this->user['title']) {
         echo HTML::chars(trim($this->user['title'])) . '<br />';
     }
     // Image
     if ($this->user['thumb']) {
         echo '<figure>' . HTML::image($this->user['thumb'], array('width' => 160)) . '</figure>';
     }
     // Last login
     echo __('Last login: :login', array(':login' => HTML::time(Date::fuzzy_span($this->user['last_login']), $this->user['last_login'])));
     return ob_get_clean();
 }
开发者ID:anqh,项目名称:core,代码行数:20,代码来源:hovercard.php

示例9: content

    /**
     * Render newsfeed.
     *
     * @return  string
     */
    public function content()
    {
        if ($items = $this->_items()) {
            ob_start();
            ?>

<ul class="media-list">

	<?php 
            foreach ($items as $item) {
                ?>
	<li class="media">
		<div class="pull-left">
			<?php 
                echo HTML::avatar($item['user']['avatar'], $item['user']['username'], $this->mini);
                ?>
		</div>
		<div class="media-body">
			<?php 
                echo HTML::user($item['user']);
                ?>
 <small class="pull-right"><?php 
                echo HTML::time(Date::short_span($item['stamp'], true, true), $item['stamp']);
                ?>
</small>
			<?php 
                echo $item['text'];
                ?>
		</div>
	</li>
	<?php 
            }
            ?>

</ul>

<?php 
            return ob_get_clean();
        }
        return __('Whoa, we are totally out of news items for you!');
    }
开发者ID:anqh,项目名称:anqh,代码行数:46,代码来源:newsfeed.php

示例10: content

    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        $friends = array();
        foreach ($this->user->find_friends() as $friend_id) {
            $friend = Model_User::find_user_light($friend_id);
            $friends[$friend['username']] = $friend;
        }
        ksort($friends, SORT_LOCALE_STRING);
        ?>

<ul class="unstyled">
	<?php 
        foreach ($friends as $friend) {
            ?>

	<li class="row-fluid">
		<?php 
            echo HTML::avatar($friend['avatar'], $friend['username']);
            ?>
		<?php 
            echo HTML::user($friend);
            ?>
		<?php 
            if ($friend['last_login']) {
                echo '<small class="ago">' . HTML::time(Date::short_span($friend['last_login'], true, true), $friend['last_login']) . '</small>';
            }
            ?>
	</li>
	<?php 
        }
        ?>

</ul>


<?php 
        return ob_get_clean();
    }
开发者ID:anqh,项目名称:core,代码行数:44,代码来源:friends.php

示例11: content

    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        ob_start();
        if ($this->blog_entries && count($this->blog_entries)) {
            // List blog entries
            foreach ($this->blog_entries as $blog_entry) {
                /** @var  Model_Blog_Entry  $blog_entry */
                $author = $blog_entry->author();
                ?>

<article class="row blog-entry">
	<div class="span1"><?php 
                echo HTML::avatar($author['avatar'], $author['username']);
                ?>
</div>

	<div class="span7">
		<header>
			<h4><?php 
                echo HTML::anchor(Route::model($blog_entry), HTML::chars($blog_entry->name));
                ?>
</h4>
			<p><?php 
                echo __('By :user :ago', array(':user' => HTML::user($author), ':ago' => HTML::time(Date::fuzzy_span($blog_entry->created), $blog_entry->created)));
                ?>
</p>
		</header>
	</div>
</article>

<?php 
            }
        } else {
            // No blog entries available
            echo new View_Alert(__('Alas, the quill seems to be dry, no blog entries found.'), View_Alert::INFO);
        }
        return ob_get_clean();
    }
开发者ID:anqh,项目名称:blog,代码行数:43,代码来源:index.php

示例12: content

    /**
     * Render newsfeed.
     *
     * @return  string
     */
    public function content()
    {
        if ($items = $this->_items()) {
            ob_start();
            ?>

<ul class="unstyled">

	<?php 
            foreach ($items as $item) {
                ?>
	<li class="row-fluid">
		<?php 
                echo HTML::avatar($item['user']['avatar'], $item['user']['username'], $this->mini);
                ?>
		<?php 
                echo HTML::user($item['user']);
                ?>
 <small class="ago"><?php 
                echo HTML::time(Date::short_span($item['stamp'], true, true), $item['stamp']);
                ?>
</small>
		<?php 
                echo $item['text'];
                ?>
	</li>
	<?php 
            }
            ?>

</ul>

<?php 
            return ob_get_clean();
        }
        return __('Whoa, we are totally out of news items for you!');
    }
开发者ID:anqh,项目名称:core,代码行数:42,代码来源:newsfeed.php

示例13: implode

    ?>
" class="<?php 
    echo implode(' ', $classes);
    ?>
">
	<?php 
    echo HTML::avatar($author['avatar'], $author['username'], true);
    ?>
	<?php 
    echo HTML::user($author);
    ?>
	<small class="ago"><?php 
    echo in_array('new', $classes) ? __('New') : '';
    ?>
 <?php 
    echo HTML::time(Date::short_span($comment->created, true, true), $comment->created);
    ?>
</small>

	<?php 
    if ($user && $comment->user_id == $user->id || $mine) {
        ?>
	<nav class="actions inline">
		<?php 
        if ($private && !$comment->private) {
            ?>
		<?php 
            echo HTML::anchor(sprintf($private, $comment->id), __('Set as private'), array('class' => 'action small comment-private'));
            ?>
		<?php 
        }
开发者ID:anqh,项目名称:core,代码行数:31,代码来源:comments.php

示例14: content

    /**
     * Render view.
     *
     * @return  string
     */
    public function content()
    {
        if (!$this->groups) {
            return new View_Alert(__('No groups available..'), __('Oh snap!'), View_Alert::ERROR);
        }
        ob_start();
        ?>

<ol class="list-unstyled">
	<?php 
        foreach ($this->groups as $group) {
            ?>

	<li>
		<h4><?php 
            echo HTML::chars($group->name);
            ?>
</h4>
		<ol class="list-unstyled">

<?php 
            $areas = $group->areas();
            if (count($areas)) {
                foreach ($areas as $area) {
                    ?>

			<li>

<?php 
                    if (Permission::has($area, Model_Forum_Area::PERMISSION_READ)) {
                        // Can read area
                        if ($area->topic_count > 0) {
                            $last_topic = $area->last_topic();
                            if ($last_topic->last_posted) {
                                echo '<small class="pull-right muted">' . HTML::time(Date::short_span($last_topic->last_posted, true, true), $last_topic->last_posted) . '</small>';
                            }
                        }
                        echo HTML::anchor(Route::model($area), HTML::chars($area->name), array('class' => 'hoverable'));
                    } elseif ($area->status != Model_Forum_Area::STATUS_HIDDEN) {
                        // Can't read area
                        echo HTML::chars($area->name);
                    }
                    ?>

			</li>

<?php 
                }
            } else {
                ?>

			<li>
				<?php 
                echo __('No areas available.');
                ?>
<br>

				<?php 
                if (Permission::has($group, Model_Forum_Group::PERMISSION_UPDATE)) {
                    ?>
					<?php 
                    echo HTML::anchor(Route::model($group, 'edit'), '<i class="icon-edit"></i> ' . __('Edit group'), array('class' => 'btn btn-inverse'));
                    ?>
				<?php 
                }
                ?>

				<?php 
                if (Permission::has($group, Model_Forum_Group::PERMISSION_CREATE_AREA)) {
                    ?>
					<?php 
                    echo HTML::anchor(Route::model($group, 'add'), '<i class="icon-plus-sign"></i> ' . __('New area'), array('class' => 'btn btn-primary'));
                    ?>
				<?php 
                }
                ?>

			</li>

<?php 
            }
            ?>

		</ol>
	</li>

	<?php 
        }
        ?>
	</ol>

<?php 
        return ob_get_clean();
    }
开发者ID:anqh,项目名称:anqh,代码行数:99,代码来源:group.php

示例15: defined

<?php

defined('SYSPATH') or die('No direct access allowed.');
/**
 * Shout
 *
 * @package    Anqh
 * @author     Antti Qvickström
 * @copyright  (c) 2010 Antti Qvickström
 * @license    http://www.opensource.org/licenses/mit-license.php MIT license
 */
$ordered = array();
foreach ($shouts as $shout) {
    $ordered[] = '<li>' . HTML::time(Date::format('HHMM', $shout->created), $shout->created) . ' ' . HTML::user($shout->author) . ': ' . Text::smileys(HTML::chars($shout->shout)) . '</li>';
}
?>

<ul>
	<?php 
echo implode("\n", array_reverse($ordered));
?>
</ul>

<?php 
if ($can_shout) {
    ?>

<?php 
    echo Form::open(Route::get('shouts')->uri(array('action' => 'shout')));
    ?>
<fieldset class="horizontal">
开发者ID:netbiel,项目名称:core,代码行数:31,代码来源:shout.php


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