public function action(Request $request, Response $response, array $args) { $loader = new Twig_Loader_Filesystem('../views/twig'); $twig = new Twig_Environment($loader, array('cache' => false)); $pdo = Database::getPDO(); $profile = new fullContact($args, $pdo); echo $twig->render("profile.twig", ['profile' => $profile->results()]); return $response; }
public function find(Request $request, Response $response, array $args) { $loader = new Twig_Loader_Filesystem('../views/twig'); $twig = new Twig_Environment($loader, array('cache' => false)); $pdo = Database::getPDO(); $search = new Search($pdo); $website = $search->searchFor($_POST['find']); echo $twig->render("form.twig", ['websites' => $website]); return $response; }