示例#1
0
 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;
 }
示例#2
0
 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;
 }