Ver Mensaje Individual
  #3 (permalink)  
Antiguo 30/12/2008, 07:50
elank0
 
Fecha de Ingreso: agosto-2004
Ubicación: In front of PC
Mensajes: 21
Antigüedad: 20 años, 6 meses
Puntos: 0
Respuesta: Duda con variables en URL [CakePHP]

Hola de nuevo,

Me guié más o menos con lo que me dijiste y ahora tengo dos métodos, el index() y el mostrar(), pero al mostrar el detalle de la noticia, no muestra nada. Este es el método que utilizo:

Código:
function mostrar($id)
	{
		if(!is_numeric($id))
		{
			$this->set('error', true);
		}
		else
		{
			$this->set('id', $id);
                        $noticia = $this->Noticia->findByid_noticia($id);
			$this->set('admin', $noticia['Noticia']['admin']);
			$this->set('content', $noticia['Noticia']['contenido']);
			$this->set('fecha', $noticia['Noticia']['fecha']);
			$this->set('titulo', $noticia['Noticia']['titulo']);
		}
		
	}
Y he aquí la vista (más o menos lo esencial):

Código HTML:
<head>
<?php echo $html->css('estilo_noticias.css', 'stylesheet'); ?>
</head>

        

<h2>Listado de Noticias</h2>



<?php echo $html->div('caja'); ?>
<?php echo $html->div('marco_superior');?>
<?php echo $html->div('titulo', '<h2 class="titulo_letras">'.$titulo.'</h2><h5 class="datos_titulo">Enviado por: '.$admin.'	||		'.$fecha.'</h5>');?>
<?php echo $html->div('contenido', $content); ?>
No sé si recojo mal las variables o que .

Gracias.

Última edición por elank0; 30/12/2008 a las 07:55