Created
January 23, 2015 21:27
-
-
Save kaioken/aa097897b13a8d15f61e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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