Template Library Version 1.4.1 - 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 Version 1.4.1 (/showthread.php?tid=12840) |
Template Library Version 1.4.1 - El Forum - 12-30-2010 [eluser]Evollution[/eluser] ok i change class to main and i get error : The "header" region has already been defined. Template Library Version 1.4.1 - El Forum - 12-31-2010 [eluser]Evollution[/eluser] http://www.fifago.com/demo2/index.php/main why i am getting this error Template Library Version 1.4.1 - El Forum - 12-31-2010 [eluser]WanWizard[/eluser] Because you initialize the template twice, or add the same region twice? Difficult to guess without seeing your code. When you load the Template library, it auto initializes the active template defined in the config file. You don't have to use set_template() yourself. Template Library Version 1.4.1 - El Forum - 12-31-2010 [eluser]Evollution[/eluser] config/template Code: $template['default']['template'] = 'template'; controler/main.php Code: <?php view/template.php Code: <html> Template Library Version 1.4.1 - El Forum - 01-01-2011 [eluser]WanWizard[/eluser] Look at the array created in config/template, and you'll see you define 'header' and 'footer' twice. Once as value of the region array, and once as key value in that same array. Do a var_dump() to see what it looks like. If you use Code: $template['default']['regions']['header'] = ... Template Library Version 1.4.1 - El Forum - 01-01-2011 [eluser]Evollution[/eluser] ok i removed and now i shoud only change <?= $header ?> with my code yes ? Template Library Version 1.4.1 - El Forum - 01-01-2011 [eluser]WanWizard[/eluser] Don't know what you mean. Your template looks ok to me (altough I wouldn't use <?=, but use <?php echo). Template Library Version 1.4.1 - El Forum - 01-07-2011 [eluser]Evollution[/eluser] i'm getting a new error : A PHP Error was encountered Severity: Notice Message: Undefined property: Main::$template Filename: controllers/main.php Line Number: 14 Fatal error: Call to a member function write() on a non-object in /home/fifagoc1/public_html/demo2/system/application/controllers/main.php on line 14 Code: <?php Template Library Version 1.4.1 - El Forum - 02-16-2011 [eluser]steelaz[/eluser] Updated line #443 in Template.php (1.4.1) from Code: $filepath = base_url() . $script; Code: $filepath = (substr(strtolower($script), 0, 4) == 'http') ? $script : base_url() . $script; so CDN scripts could be added: Code: $this->template->add_js('https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'); Template Library Version 1.4.1 - El Forum - 03-03-2011 [eluser]nsbingham[/eluser] Evollution - I'm experiencing the same error. Were you able to figure it out? |