コード例 #1
0
ファイル: peopleController.php プロジェクト: Rayac/search
 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
ファイル: searchController.php プロジェクト: Rayac/search
 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;
 }