The following code is showing the following error:
Warning: require_once(/home/..../public_html/edu) [function.require-once]: failed to open stream: Success in /home/..../public_html/edu/index.php on line 25
Fatal error: require_once() [function.require]: Failed opening required '' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/..../public_html/edu/index.php on line 25
How can I solve this problem?
<?php
class Model
{
public $tstring;
public function __construct(){
$this->tstring = "The string has been loaded through the template.";
$this->template = "tpl/template.php";
}
}
class View
{
private $model;
public function __construct($model) {
$this->controller = $controller;
$this->model = $model;
}
public function output(){
$data = "<p>" . $this->model->tstring ."</p>";
require_once($this->model->template); //line 25 Attention!!!!!!!!
}
}
class Controller
{
private $model;
public function __construct($model){
$this->model = $model;
}
public function clicked() {
$this->model->string = "Updated Data, thanks to MVC and PHP!";
}
}
$model = new Model();
$controller = new Controller($model);
$view = new View($controller, $model);
echo $view->output();