[eluser]Unknown[/eluser]
Hello all,
I have a question about two forms to do something that for me are the same:
I have the next tree files,
Controller.php
Code:
function lista(){
$datos=array(
'titulo' => 'Usuarios',
'pagina' => $this->parser->parse('usuarios_lista',array(),TRUE),
'test' => 'Este es un test',
);
$this->parser->parse('template',$datos);
}
template.php
Code:
<h1>{titulo}</h1>
{pagina}
usuarios_lista.php
I can see the output in the browser:
Code:
<h1>Usuarios</h1>
Este es un test
But the problem is when I want use PHP inside the html code:
Controller.php
Code:
function lista(){
$datos=array(
'titulo' => 'Usuarios',
'pagina' => $this->load->view('usuarios_lista',array(),TRUE),
'test' => 'Este es un test',
);
$this->load->view('template',$datos);
}
template.php
Code:
<h1><? echo $titulo;?></h1>
<? echo $pagina; ?>
usuarios_lista.php
Code:
<?echo $test;?>
The code before said to me an error about test variable, that is unknown.
Someone has an idea for solve this problem?
Thanks in advanced