Robert1995 Posted May 30, 2011 Report Posted May 30, 2011 (edited) 1. Mi-a venit inspiratia si am facut asta Code Igniter , how to "layout"$data['target_page']['first_page'] = 'view_page'; -> 'view_page' e pagina care vreau sa se "loadeze" asa ar veni , gata cu durerile de cap Controllerclass frontend extends CI_Controller { public function __construct() { parent::__construct(); // Your own constructor code //Load my Models } public function index(){ $data = array(); $data['title'] = 'Some Title'; $data['welcome'] = "Robert's Page"; $data['target_page'] = array(); $data['target_page']['first_page'] = 'view_page'; $this->load->view('layout' , $data); }}The View<head></head><body><div id="wrapper"> <div id="header"> <div id="logo"> </div> </div> <div id="menu"> </div> <div id="content"> <?php foreach($target_page as $tp): ?> <?php $this->load->view($tp); ?> <div class="clear"></div> <?php endforeach;?> </div> <div id="footer"> </div></div></body>Astept Comentarii , o sa continui postul cu edituri daca mai trebuie Edited May 30, 2011 by Robert1995 Quote
hammerfall Posted May 30, 2011 Report Posted May 30, 2011 Aveam facut eu un mic trick, prin care incarcai ceva de genul $this->load->layout('pageX', $data'); unde pageX este pagina din layout care o incarci. O sa il caut zilele astea prin PC daca-l mai am. 1 Quote
Robert1995 Posted May 30, 2011 Author Report Posted May 30, 2011 (edited) ma crezi ca nu stiam ca exista layout pe codeigniter ? dar am gasit Click Still anyway for newbies merge mai bine varianta mea .Edit : Mersi Hammer , nu credeam ca o sa mai invat ceva azi Edited May 30, 2011 by Robert1995 Quote
hammerfall Posted May 30, 2011 Report Posted May 30, 2011 De fapt, trick-ul meu era mult mai simplu. Nu era chiar o librarie, dar permitea sa incarci o pagina membra a unui layout sau o pagina fara layout (cum ar fi un banner, un cod js dinamic, etc). Quote