Skip to content

Instantly share code, notes, and snippets.

@TiuTalk
Forked from gabrielslau/gist:1919160
Created February 26, 2012 22:04
Show Gist options
  • Save TiuTalk/1919274 to your computer and use it in GitHub Desktop.
Save TiuTalk/1919274 to your computer and use it in GitHub Desktop.
<?php
public function view($codigo = null) {
// Encontra a notícia pelo campo código
$noticia = $this->Noticia->findByCodigo($codigo);
// Não encontrou?
if (empty($noticia))
throw new NotFoundException(__('Invalid noticia'));
// Passa pra view
$this->set('noticia', $noticia);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment