[eluser]Unknown[/eluser]
Hi i'm using this library:
Code:
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Layout
{
var $obj;
var $layout;
function Layout($layout = "master_page")
{
$this->obj =& get_instance();
$this->layout = $layout;
}
function setLayout($layout)
{
$this->layout = $layout;
}
function view($view, $data=null, $return=false)
{
$loadedData = array();
$loadedData['content'] = $this->obj->load->view($view,$data,true);
if($return)
{
$output = $this->obj->load->view($this->layout, $loadedData, true);
return $output;
}
else
{
$this->obj->load->view($this->layout, $loadedData, false);
}
}
}
And my HTML is this:
Code:
<!doctype html>
<html lang="pt-br">
<head>
<meta charset="utf-8" />
<title>Don't listen to Le Corbusier | acazsouza.com.br</title>
<link rel="stylesheet" type="text/css" href="/resources/css/reset.css" media="screen, projection">
<link rel="stylesheet" type="text/css" href="/resources/css/style.css" media="screen, projection">
<!--[if lt IE 9]>
[removed]
// Via Remy Sharp (@rem): http://remysharp.com/2009/01/07/html5-enabling-script/
/*@cc_on'abbr article aside audio canvas code details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video'.replace(/\w+/g,function(n){document.createElement(n)})@*/
[removed]
<![endif]-->
</head>
<body>
<header>
<h1><a href="/">acazsouza.com.br</a></h1>
</header>
<div class="c">
<article>
<?php echo $content?>
</article>
<aside>
<section class="autor">
<h1>Autor</h1>
<ul>
<li><a href="#" title="E-mail de contato" class="gmail">[email protected]</a></li>
<li><a href="http://www.twitter.com/acazsouza" title="Twitter" class="twitter" target="_blank">@acazsouza</a></li>
<li><a href="#" title="Live Messenger" class="messenger">[email protected]</a></li>
</ul>
</section>
<section class="categorias">
<h1>Categorias</h1>
<ul>
<li><a href="/artigos/">adequatelygood</a></li>
<li><a href="/artigos/">css</a></li>
<li><a href="/artigos/">debugging</a></li>
<li><a href="/artigos/">html5</a></li>
<li><a href="/artigos/">javascript</a></li>
<li><a href="/artigos/">jquery</a></li>
<li><a href="/artigos/">module pattern</a></li>
<li><a href="/artigos/">performance</a></li>
<li><a href="/artigos/">python</a></li>
<li><a href="/artigos/">slide</a></li>
</ul>
</section>
</aside>
</div>
</body>
</html>
So, in the aside tag i need to this is dinamycall, but i don't want to put the code to do this in all controller, i want to put the code to load this part in one place only, how i do this?