当前位置: 首页>>代码示例>>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;未经允许,请勿转载。