Skip to content

Instantly share code, notes, and snippets.

@kaioken
Created January 23, 2015 21:27
Show Gist options
  • Save kaioken/aa097897b13a8d15f61e to your computer and use it in GitHub Desktop.
Save kaioken/aa097897b13a8d15f61e to your computer and use it in GitHub Desktop.
<?php
use Phalcon\Mvc\Controller;
class PeliculasController extends Controller
{
public function indexAction()
{
$peliculas = Peliculas::find();
foreach($peliculas as $pelicula){
if($pelicula->parent_id == 0){
echo $pelicula->nombre . "<br/>";
} elseif ($pelicula->parent_id == 1){
echo "-" . $pelicula->nombre . "<br />";
} elseif ($pelicula->parent_id == 2){
echo "--" . $pelicula->nombre . "<br />";
} elseif ($pelicula->parent_id == 3){
echo "---" . $pelicula->nombre . "<br />";
} elseif ($pelicula->parent_id == 4){
echo "----" . $pelicula->nombre . "<br />";
} elseif ($pelicula->parent_id == 5){
echo "-----" . $pelicula->nombre . "<br />";
} elseif ($pelicula->parent_id == 6){
echo "------" . $pelicula->nombre . "<br />";
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment