Welcome Guest, Not a member yet? Register   Sign In
How to load a view like theme_view('metadata')
#2

[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>
&lt;html&gt;
&lt;head&gt;
  &lt;?php echo theme_view('metadata'); ?&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;?php echo $template['body']; ?&gt;
&lt;/body&gt;
&lt;/html&gt;

Code:
application/themes/my_theme/views/metadata.php

The content of metadata.php is:
Code:
&lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;&lt;?php echo $template['title']; ?&gt;&lt;/title&gt;

&lt;?php echo css('style.css'); ?&gt;
&lt;?php echo js('http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'); ?&gt;

&lt;?php echo $template['metadata']; ?&gt;

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?


Messages In This Thread
How to load a view like theme_view('metadata') - by El Forum - 11-26-2010, 08:03 PM
How to load a view like theme_view('metadata') - by El Forum - 11-27-2010, 08:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB