Ejemplo n.º 1
1
<?php

require_once 'connection.php';
require_once 'model/movies.php';
$q = $_GET['q'];
$conn = getConnection();
$movieModel = new Movies($conn);
$matches = $movieModel->search($q);
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta charset="UTF-8">
    <link rel="icon" href="img/page-icon.png">
    <title>2014 Movie Revenues</title>
    
    <!-- bootstrap css -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

</head>

<body class="container">
    
    <h1>Movie Revenues From 2014</h1>

    <?php 
include 'views/search-view.php';
include 'views/results.php';
?>
Ejemplo n.º 2
0
 public function searchAction($search, $page = 1, Movies $movie)
 {
     //1、这个搜索应该设置中间件来对关键词进行过滤的!直接的路由正则过滤是否就足够了?
     //2、是否需要对search关键词进行保存,以便将来进行行为分析,看看都搜索过哪些关键词?这个也许是将来的一个数据挖掘的要点,当然也可以用log的形式来做记录和分析
     //3、需要增加多个关键词的搜索情况,比如多个关键词都存在的情况下如何检索,这个可以在Model中增加处理逻辑
     $page = $this->getPaginator($movie->search($search), 25, $page);
     $this->view->page = $page;
     $this->view->search = $search;
 }