本文整理汇总了PHP中Stack::object方法的典型用法代码示例。如果您正苦于以下问题:PHP Stack::object方法的具体用法?PHP Stack::object怎么用?PHP Stack::object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stack
的用法示例。
在下文中一共展示了Stack::object方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Show user
*/
public function render($type = NULL, $param = 'avatar.profile')
{
switch ($type) {
case 'list':
$navbar = new Stack(array('name' => 'user.navbar'));
$navbar->object($this);
$navbar->avatar = $this->getAvatarImage($param);
$navbar->name = '<strong><a href="' . $this->getLink() . '">' . $this->getName(NULL) . '</a></strong>';
if (access('User.edit', $this)) {
$navbar->edit = '<a href="' . $this->getLink('edit') . '" class="sh" title="' . t('Редактировать') . '"><i class="icon-pencil"></i></a>';
}
return $navbar->render();
break;
default:
}
}
示例2: 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>
示例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 id="profile" class="shd">
<?php
$userinfo = new Stack('profile.user');
$userinfo->append($user->getAvatar('profile'));
$userinfo->append($user->getName());
if (access('User.edit', $user)) {
$userinfo->append(HTML::a($user->getLink('edit'), icon('pencil'), array('class' => 'sh')));
}
echo '<div class="page-header"><h2>' . $userinfo . '</h2></div>';
?>
<div class="form-horizontal profile_fields">
<?php
$fields = new Stack(array('name' => 'user.profile.fields'));
$fields->object($user);
$fields->append(array('label' => t('Зарегистрирован'), 'value' => df($user->reg_date)));
$fields->append(array('label' => t('Последнее посещение'), 'value' => df($user->last_visit)));
$fields->init();
foreach ($fields as $field) {
?>
<div class="control-group">
<div class="control-label"><?php
echo $field['label'];
?>
</div>
<div class="controls"><?php
echo $field['value'];
?>
</div>
</div>
<?php