Template library : add_region() - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Template library : add_region() (/showthread.php?tid=30115) |
Template library : add_region() - El Forum - 05-03-2010 [eluser]Marcela[/eluser] Hello, I am new to CodeIgniter, a friend of mine recommended me this framework, he gave me a zip with an installation base that included the Template library(Collin Williams). After reading the documentation and play around with the library, I have only one question, how do you add a region to the template and that this be printed? I have set three fixed regions in the configuration file of the Template library: -header -content -footer I have this files into my application folder: controllers/test.php Code: <?php views/template.php Code: <html> The problem as you can see is, how the hell I do to make the new region is displayed in the output??. I mean how add: Code: <?php echo $extra ?> To template, how?? Maybe passed loading a view(error... I try this yet), $this->load->vars, abracadabra, shazaamm!!, a pact with the devil. thank you in advance. Template library : add_region() - El Forum - 05-04-2010 [eluser]ralf57[/eluser] A quick look at the library shows that there's a "add_region" method that does just what you need. The next time have a look at the code before posting help requests, you can save a lot of time ;-) Template library : add_region() - El Forum - 05-04-2010 [eluser]Marcela[/eluser] [quote author="ralf57" date="1272974462"]A quick look at the library shows that there's a "add_region" method that does just what you need. The next time have a look at the code before posting help requests, you can save a lot of time ;-)[/quote] You dont read the complete post. I know the method add_region() exist, if you read the code I used it, my question is, How I do to get the NEW region displayed?, beacuse as I say I have only three regions (fixed) on config(template) and in template file. I mean how I tell the template to echo the region. Template library : add_region() - El Forum - 05-04-2010 [eluser]ralf57[/eluser] I am afraid that you cannot write to region whithout the matching variable in the template ($extra in you case). The "add_region" is useful when you need to load different templates, but it doesn't seem to be your case Template library : add_region() - El Forum - 05-05-2010 [eluser]Marcela[/eluser] Well, thank you anyway, Template library rock's, but this function ( add_region() ) seems more useful than it really is. |