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


PHP Stack::render方法代码示例

本文整理汇总了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('/'));
 }
开发者ID:brussens,项目名称:cogear2,代码行数:33,代码来源:Object.php

示例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>
开发者ID:brussens,项目名称:cogear2,代码行数:26,代码来源:list.php

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

示例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>
开发者ID:romartyn,项目名称:cogear,代码行数:31,代码来源:page.php

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


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