<?php

class TestimonialController extends baseController {
    function index() {
    	$testimonialModel = new testimonialModel();

        $tes_id = $this->registry->args[1];

        if (!is_numeric($tes_id) && $tes_id != 'all')
            $tes_id = "all";

        $cond = [];
        if ($tes_id != 'all') {
        	$testimonial = $testimonialModel->get($tes_id);
        	$cond = ['tes_id' => $tes_id];
        } else {
        	$testimonial = [
        		'id' => 'all',
        		'title' => 'All'
        	];
        }
        $testimonials = $testimonialModel->getList();

    	require('views/testimonial/testimonial.tpl.php');
    }
}
?>