本文整理汇总了PHP中Stack::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Stack::render方法的具体用法?PHP Stack::render怎么用?PHP Stack::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stack
的用法示例。
在下文中一共展示了Stack::render方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLink
/**
* Get post Uri
*
* @return string
*/
public function getLink($type = 'default', $param = NULL)
{
switch ($type) {
case 'edit':
$uri = new Stack(array('name' => 'post.link.edit'));
$uri->append('post');
$uri->append('edit');
break;
case 'delete':
$uri = new Stack(array('name' => 'post.link.edit'));
$uri->append('post');
$uri->append('delete');
break;
case 'hide':
$uri = new Stack(array('name' => 'post.link.hide'));
$uri->append('post');
$uri->append('hide');
break;
case 'full':
return '<a href="' . $this->getLink() . $param . '">' . $this->name . '</a>';
break;
default:
$uri = new Stack(array('name' => 'post.link'));
$uri->append('post');
}
$uri->append($this->id);
return l('/' . $uri->render('/'));
}
示例2: Stack
<table class="table table-bordered table-striped">
<thead>
<tr>
<?php
$thead = new Stack(array('name' => $options->name . '.thead'));
$thead->append('<th>' . t('Имя пользователя') . '</th>');
$thead->append('<th>' . t('Постов') . '</th>');
cogear()->gears->Comments && $thead->append('<th>' . t('Комментариев') . '</th>');
$thead->append('<th>' . t('Зарегистрирован') . '</th>');
echo $thead->render();
?>
</tr>
</thead>
<tbody>
<?php
foreach ($users as $user) {
$tr = new Stack(array('name' => $options->name . '.tr'));
$tr->append('<td>' . $user->getLink('avatar') . ' ' . $user->getLink('profile') . '</td>');
$tr->append('<td>' . $user->posts . '</td>');
cogear()->gears->Comments && $tr->append('<td>' . $user->comments . '</td>');
$tr->append('<td>' . df($user->reg_date, 'd M Y') . '</td>');
echo '<tr>' . $tr->render() . '</tr>';
}
?>
</tbody>
</table>
示例3: Stack
</div>
<?php
$before = new Stack(array('name' => 'post.before'));
$before->object($item);
echo '<div class="post-before">' . $before->render() . '</div>';
?>
<div class="post-body">
<?php
echo $item->body;
?>
</div>
<?php
$after = new Stack(array('name' => 'post.after'));
$after->object($item);
echo '<div class="post-after">' . $after->render() . '</div>';
?>
<div class="post-info">
<?php
$info = new Stack(array('name' => 'post.info'));
$info->object($item);
$info->time = '<span class="post-time">' . df($item->created_date) . '</span>';
echo $info->render();
?>
</div>
</article>
<?php
if (!($item->teaser or $item->preview)) {
$after = new Stack(array('name' => 'post.full.after'));
$after->object($item);
echo $after->render();
}
示例4: Stack
<div class="page">
<div class="page-title">
<? $title = new Stack('Page.title') ?>
<? $title->name = '<h1>' . ($item->in_grid ? HTML::a($item->getUrl(), $item->name) : $item->name) . '</h1>' ?>
<?
if ($cogear->user->id === $item->aid OR access('pages edit_all')) {
$title->edit = HTML::a(Url::gear('pages') . 'edit/' . $item->id, t('[edit]'),array('class'=>'edit'));
}
?>
<?php
echo $title;
?>
</div>
<div class="page-content">
<?php
echo $item->body;
?>
</div>
<div class="page-info">
<? $info = new Stack('Page.info');
$info->object($item);
$info->created_date = '<span class="created_date">' . df($item->created_date) . '</span>' ?>
<?
$user = new User_Object($item->aid);
$info->author = '<span class="author">' .$user->getAvatarLinked().' '.$user->getLink() . '</span>';
?>
<?php
echo $info->render();
?>
</div>
</div>
示例5: getPanel
/**
* Get user panel — for profile and other pages
*
* @return string
*/
public function getPanel()
{
$cogear = getInstance();
$panel = new Stack('user.panel');
$avatar = $this->getAvatar();
$panel->avatar = $avatar;
$panel->login = HTML::a($this->getProfileLink(), $this->login, array('class' => 'implicit login'));
if (access('user edit_all') or $this->id == $cogear->user->id) {
$panel->edit = HTML::a(Url::gear('user') . 'edit/' . $this->id, t('[edit]'), array('class' => 'edit'));
}
return $panel->render();
}