0byt3m1n1-V2
Path:
/
home
/
nlpacade
/
www
/
arcaneoverseas.com
/
application
/
controllers
/
[
Home
]
File: gestion_contenu.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Gestion_Contenu extends CI_Controller { /** * Index Page for this controller. * * Maps to the following URL * http://example.com/index.php/welcome * - or - * http://example.com/index.php/welcome/index * - or - * Since this controller is set as the default controller in * config/routes.php, it's displayed at http://example.com/ * * So any other public methods not prefixed with an underscore will * map to /index.php/welcome/<method_name> * @see http://codeigniter.com/user_guide/general/urls.html */ /* * Doctrine EntityManager */ public $em; public $config_site; /* * constructeur */ public function __construct() { header('Content-Type: text/html; Charset=UTF-8'); parent::__construct(); //Instantiate a Doctrine Entity Manager $this->em = $this->doctrine->em; $this->config_site = $this->doctrine->em->getRepository('Entities\Config')->find(1); } public function index($param) { $data = array(); //article $article = $this->em->getRepository('Entities\GestionContenu')->findOneBy(array("sku" => $param, "active" => "oui", "type_contenu" => "1")); //block statiques $block = $this->getBlock(); //partenaire $partenaires = $this->em->getRepository('Entities\GestionContenu')->findBy(array("active" => "oui", "type_contenu" => "5")); //liste trainers $eventsRleft = $this->em->getRepository('Entities\Event')->findOneBy(array("active" => "oui", "left" => "oui")); //xml $this->layout->set_xml($article->getXml()); //fandel data $data["article"] = $article; $data["block"] = $block; $data["partenaires"] = $partenaires; $data["eventsRleft"] = $eventsRleft; //handel layout $this->layout->views('header', $data) ->views('menu_top', $data) ->views('slider', $data) ->views('menu_left', $data) ->views('content', $data) ->view('footer', $data); } public function getBlock() { $blocks = $this->em->getRepository('Entities\Block')->findAllToArray(); $arrayBlock = array(); foreach ($blocks as $block) { $arrayBlock[$block['indetifiant']] = $block['contenu']; } return $arrayBlock; } } /* End of file welcome.php */ /* Location: ./application/controllers/welcome.php */
©
2018.