[eluser]duartix[/eluser]
[quote author="noideawhattotypehere" date="1377868499"]
in view
Code:
<?php echo $username?>
[/quote]
It still doesn't recognize the variable.
Let me put it in the crudest of forms:
application/controllers/home.php :
Code:
<?php
class Home extends CI_Controller {
public function index() {
$username = 'ME!';
$this->load->view('templates/logged', $username);
}
}
application/views/templates/logged.php :
Code:
<?php echo $username ?>
This is what I get:
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: username
Filename: templates/logged.php
Line Number: 2
What am I doing wrong?