SHARE
TWEET

Untitled

a guest Jul 17th, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php defined('BASEPATH') OR exit('No direct script access allowed');
  2.  
  3. class Spa extends FrontendController
  4. {
  5.     private $path       = "spa/";
  6.     private $template   = "template";
  7.    
  8.     public function __construct()
  9.     {
  10.         parent::__construct();
  11.        
  12.         $this->load->model("spa_model");
  13.     }
  14.    
  15.     public function index()
  16.     {
  17.         $data["menu"] = $this->spa_model->tree(t("actual_locale"));
  18.         $data["titulo"] = "El Spa";
  19.         $data["view"] = $this->load->view($this->path."index", $data, TRUE);
  20.        
  21.         $this->load->view($this->template, $data);
  22.     }
  23.    
  24.     public function slug()
  25.     {
  26.         $slug = $this->uri->segment(2);
  27.        
  28.         if(null == $slug)
  29.             redirect("");
  30.        
  31.         $pagina = $this->spa_model->getByName($slug);
  32.        
  33.         if(false == $pagina)
  34.             redirect("");
  35.        
  36.         $data["slug"] = $slug;
  37.         $data["page"] = $this->spa_model->get($pagina->id, t("actual_locale"));
  38.         $data["menu"] = $this->spa_model->tree(t("actual_locale"));;
  39.        
  40.         $data["view"] = $this->load->view($this->path."slug", $data, TRUE);
  41.        
  42.         $this->load->view($this->template, $data);
  43.     }
  44. }
RAW Paste Data
Top