Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created November 4, 2012 13:52
Show Gist options
  • Save eminetto/4012005 to your computer and use it in GitHub Desktop.
Save eminetto/4012005 to your computer and use it in GitHub Desktop.
<div class="actions clearfix">
<div class="btns">
<a class="btn submit" href="/admin/index/save" title="Criar Post">Criar Post</a>
</div>
</div>
<label class="divisor"><span>Lista de Posts</span></label>
<table class="datatable">
<thead>
<tr>
<th>Título</th>
<th>Texto</th>
<th width="130" class="center">Data de Cadastro</th>
<th width="120" class="center">Opções</th>
</tr>
</thead>
<tbody>
<?php foreach($posts as $post):?>
<tr>
<td><?php echo $this->escapeHtml($post['title']);?></td>
<td><?php echo $this->escapeHtml($post['description']);?></td>
<td class="center">
<?php
echo $this->dateFormat($post['post_date'], \IntlDateFormatter::SHORT, \IntlDateFormatter::SHORT, 'pt_BR');
?>
</td>
<td class="center">
<a href="/admin/index/save/id/<?php echo $post['id'] ;?>" title="Editar" class="btn"><i class="icon-edit"></i></a>
<a href="/admin/index/delete/id/<?php echo $post['id'];?>" rel="confirmation" title="Deseja excluir este registro?" class="btn"><i class="icon-remove"></i></a>
</td>
</tr>
<?php endforeach;?>
</table>
@lgveronese
Copy link

Elton,

Apenas uma correção nas linhas 27 e 28:


*** Lembrando que no projeto está faltando a pasta de imagens do Bootstrap

@lgveronese
Copy link

Não sei porque não foi o código, mas segue novamente:

      <a href="/admin/index/save/id/<?php echo $post['id'] ;?>" title="Editar" class="btn"><i class="icon-edit"></i></a>
      <a href="/admin/index/delete/id/<?php echo $post['id'];?>" rel="confirmation" title="Deseja excluir este registro?" class="btn"><i class="icon-remove"></i></a>

@eminetto
Copy link
Author

Obrigado pela correção. Já alterei no livro também

@michelcandido
Copy link

Elton,

Na linha 23 não estava apresentando o resultado em tela, tive de fazer da seguinte forma:
echo $this->dateFormat(
new DateTime($post['post_date']),
\IntlDateFormatter::SHORT,
\IntlDateFormatter::SHORT,
'pt_BR'
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment