Example #1
0
<h1 class="page-header">
    Noticias
    <small>Test de Noticias</small>
</h1>
<?php 
foreach ($noticias as $noticia) {
    $usuario = new UsuarioNoticia();
    $usuario->where_related_noticia('id', $noticia->id)->get();
    $foto = new Foto();
    $foto->where_related_noticia('id', $noticia->id)->get();
    ?>
<!-- First Blog Post -->
<h2>
    <a href="<?php 
    echo site_url('noticias/' . url_title($noticia->titular) . '-id-' . $noticia->id . '');
    ?>
.html">
    <?php 
    echo $noticia->titular;
    ?>
</a>
</h2>
<p class="lead">
    by <a href="#"><?php 
    echo ucfirst($usuario->nombre);
    ?>
</a>
</p>
<p><span class="glyphicon glyphicon-time"></span> <?php 
    echo fecha_normal($noticia->fecha);
Example #2
0
					<tr>
						<th>Titular</th>
						<th>Autor</th>
						<th>fecha</th>

						<th>Acciones</th>						
					</tr>								
				</thead>

				<tbody>
					<?php 
foreach ($noticias as $noticia) {
    $usuario = new UsuarioNoticia();
    $usuario->where_related_noticia('id', $noticia->id)->get();
    $fotoUsuario = new Foto();
    $fotoUsuario->where_related_noticia('id', $usuario->id)->get();
    ?>
						<tr>
							<td><?php 
    echo $noticia->titular;
    ?>
</td>
							<td><?php 
    echo $usuario->nombre;
    ?>
								<?php 
    if ($fotoUsuario->ruta) {
        ?>
								<br><img style="max-width:50px;text-align: center;margin: 0 auto;display: block;" src="<?php 
        echo site_url($fotoUsuario->ruta);
        ?>