當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。