Template library : add_region() |
[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.
[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 ;-)
[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.
[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
[eluser]Marcela[/eluser]
Well, thank you anyway, Template library rock's, but this function ( add_region() ) seems more useful than it really is. |
Welcome Guest, Not a member yet? Register Sign In |