function construct(&$path) { if ($path == '/index' or $path == '/home' or $path == '/') { homeView(); } else { if ($path == '/about') { aboutView(); } else { if ($path == '/create') { createView(); } else { if (strpos($path, '/posts/') !== false) { postView($path); } else { if ($path == '/login') { loginView(); } else { if ($path == '/search') { searchView(); } else { if ($path == '/admin/settings') { adminView(); } else { if ($path == '/admin/dashboard') { adminDashboardView(); } else { if ($path == '/logout') { logout(); } else { errorView('404 Not Found', errorMessage); } } } } } } } } } }
<?php $data = $_GET; if (isset($data['text']) && !empty($data['text']) && strlen($data['text']) > 3) { $text = $data['text']; $text = trim($text); $text = htmlspecialchars($text); } else { errorWithMessage('Поисковый запрос не введен, либо он меньше 4 символов!'); } include_once '../models/Book.php'; $book = new Book(); $books = $book->poiskBooks($text); $view = 'poisk.php'; if (!isset($view)) { errorView(); } include_once '../views/shablon.php';
<figure><?php echo $image['caption']; ?> </figure> </a> <?}?> </div> <?if($lastPage > 1){?> <div class="col s12"> <?php echo createLinks($total, $page, $perPage); ?> </div> <?} } else { errorView($data['error_message']); }?> </div> </div> <div id="footer" class="section"> © 2015 <a class="<?php echo $config['theme_text']; ?> " href="http://alashov.com" target="_blank">by Alashov</a> </div> </div> </div> <!-- PhotoSwipe Markup --> <div id="gallery" class="pswp" tabindex="-1" role="dialog" aria-hidden="true"> <div class="pswp__bg"></div> <div class="pswp__scroll-wrap">