[eluser]Deathmanlp[/eluser]
Hi there
Im learning PHP and CI and i'm trying to create a simple controller
The controller
Code:
<?php
class Start extends Controller
{
var $base;
var $css;
function Start ()
{
parent ::Controller();
$this->base = $this->config->item('base_url');
$this->css=$this->config->item("css");
}
function hello($name)
{
$data["title"]="Title";
$data['base'] = $this->base;
$data["css"]=$this->css;
$data['text'] = "Hello, $name, Welcome to $base!";
$this->load->view("start_view", $data);
}
}
?>
The view
Code:
<html>
<head>
<title>
<?php echo "$title";?>
</title>
<link rel="stylesheet" type="text/css" href="<?php echo"$base/$css"?>" />
</head>
<body>
<p>
<?php echo "$text"; ?>
</p>
</body>
</html>
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: base
Filename: controllers/start.php
Line Number: 17
I can't fix this