當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Stack::append方法代碼示例

本文整理匯總了PHP中Stack::append方法的典型用法代碼示例。如果您正苦於以下問題:PHP Stack::append方法的具體用法?PHP Stack::append怎麽用?PHP Stack::append使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Stack的用法示例。


在下文中一共展示了Stack::append方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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 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 
開發者ID:brussens,項目名稱:cogear2,代碼行數:31,代碼來源:user.php


注:本文中的Stack::append方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。