PageRenderTime 36ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/masportales/application/controllers/web.php

https://github.com/eloypineda/XHTMLized
PHP | 61 lines | 31 code | 11 blank | 19 comment | 4 complexity | f976ad13b0fdcc4d7964855c889fa200 MD5 | raw file
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2. class Web extends Front_Controller {
  3. public function _remap($method, $arguments = array())
  4. {
  5. global $class;
  6. $this->load->model('ecommerce_model');
  7. $this->load->model('companies_model');
  8. $this->load->library('form_validation');
  9. $this->registry->set('module', $class, 'request');
  10. /*
  11. echo '<pre>';
  12. print_r($class);
  13. echo '</pre>';
  14. echo '<pre>';
  15. print_r($method);
  16. echo '</pre>';
  17. echo '<pre>';
  18. print_r($arguments);
  19. echo '</pre>';
  20. */
  21. if ($method == 'index') {
  22. show_404();
  23. } elseif ($company_id = $this->companies_model->slugFor($method)) {
  24. (isset($arguments[0])) ? $page = $arguments[0] : $page = 'index';
  25. // TODO: create a function to get the banner.
  26. $params = array(
  27. 'limit' => '1',
  28. 'filter_by' => 'company_ID',
  29. 'filter' => $company_id
  30. );
  31. $banner = $this->companies_model->getMicrositeBanners($params);
  32. $data = array(
  33. 'company' => $this->companies_model->getCompany($company_id),
  34. 'company_images' => $this->companies_model->getCompanyImages($company_id),
  35. 'microsite_pages' => $this->companies_model->getCompanyMicrosite($company_id),
  36. 'banner' => $banner[0]
  37. );
  38. } else {
  39. show_404();
  40. }
  41. /*
  42. echo '<pre>';
  43. print_r($page);
  44. echo '</pre>';
  45. */
  46. $this->load->view('microsites/default/layout', $data);
  47. }
  48. }
  49. /* End of file web.php */
  50. /* Location: ./application/controllers/web.php */