Advertisement
VladimirsBudkins

Роман Белов

May 6th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2. $route['default_controller'] = 'page';
  3.  
  4. class Page extends CI_Controller {
  5.  
  6.     public function index() {
  7.         $this->show('index');
  8.     }
  9.  
  10.     public function show($page_name = "about") {
  11.         $pages = ["about", "price", "catalog", "conditions", "contacts"];
  12.         $data["data"] = $this->page_model->get_page($page_name);
  13.         $data["view"] = "default";
  14.         if (in_array($page_name, $pages)) {
  15.             $data["view"] = $page_name;
  16.         }
  17.         $this->layout->user($data);
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement