How to load a view like theme_view('metadata') - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: How to load a view like theme_view('metadata') (/showthread.php?tid=36274) |
How to load a view like theme_view('metadata') - El Forum - 11-26-2010 [eluser]Massimiliano Marini[/eluser] Hi all, In my theme I want to load the metadata.php file directly in default.php file, like theme_view('metadata'). My complete folder structure is this: Code: application/themes/my_theme/views/layouts/default.php and the metadata.php is here: Code: application/themes/my_theme/views/metadata.php Into default .php between Code: <head></head> Code: theme_view('metadata') I think it must be something like a theme_helper.php, Phil Sturgeon do this in PyroCMS, I've tried to reproduce it but without success. Any idea or help? How to load a view like theme_view('metadata') - El Forum - 11-27-2010 [eluser]Massimiliano Marini[/eluser] I try to give more information with my code: Code: application/themes/my_theme/views/layouts/default.php The content of default.php is: Code: <!DOCTYPE HTML> Code: application/themes/my_theme/views/metadata.php The content of metadata.php is: Code: <meta http-equiv="content-type" content="text/html; charset=utf-8" /> In default.php file I want to write only theme_view('metadata') and not $template['partials']['metadata'] because I do not want to write in every controller: $this->template->set_partial('metadata', 'metadata'), I do not like this. How do you do this? |