コード例 #1
0
ファイル: MovieController.php プロジェクト: unused/yii-lmdb
 /**
  * Import movies
  */
 public function actionImport()
 {
     if ($movies = CHttpRequest::getPost('movies', false)) {
         foreach (explode("\n", $movies) as $key => $movie) {
             if (!ImportLog::model()->find('import_name=:movie', array(':movie' => $movie))) {
                 if (substr($movie, -2) == 02) {
                     continue;
                 }
                 // 2nd part
                 $search = SearchController::search(str_replace(array('-', '01'), ' ', $movie));
                 $log = new ImportLog();
                 $log->import_name = $movie;
                 $log->search_id = $search->id;
                 $log->save();
             }
         }
     }
     $this->render('import', array('imported_movies' => ImportLog::model()->findAll()));
 }
コード例 #2
0
ファイル: desktop.php プロジェクト: DavidGarciaCat/eyeos
 public static function search($params)
 {
     $searchController = new SearchController();
     $results = $searchController->search($params);
     return $results;
 }
コード例 #3
0
ファイル: routes.php プロジェクト: nopomi/abinet
});
$routes->get('/institution/:id/update', function ($id) {
    InstitutionController::edit($id);
});
$routes->post('/institution/:id/update', function ($id) {
    InstitutionController::update($id);
});
$routes->post('/institution/:id/delete', function ($id) {
    InstitutionController::delete($id);
});
$routes->get('/suggestions', function () {
    SuggestionController::index();
});
$routes->get('/suggestion/new', function () {
    SuggestionController::create();
});
$routes->post('/suggestion/new', function () {
    SuggestionController::store();
});
$routes->post('/suggestion/:id/update', function ($id) {
    SuggestionController::toggleProcessed($id);
});
$routes->post('/suggestion/:id/delete', function ($id) {
    SuggestionController::delete($id);
});
$routes->get('/search', function () {
    SearchController::index();
});
$routes->post('/search', function () {
    SearchController::search();
});
コード例 #4
0
ファイル: SearchController.php プロジェクト: unused/yii-lmdb
 public function actionIndex()
 {
     $this->render('index', array('callback' => SearchController::search(CHttpRequest::getQuery('text'))));
 }