When I use the built in PDO layer in TinyMVC to request records from a table, it returns the following error:
Array
Error: 0
Message: Unknown file 'register_view.php'
File:{redacted}tinymvc\sysfiles\plugins\tinymvc_view.php
Line: 125
When I however try just returning the same variable without a connection it displays it fine. The error it is raising is in the view layer because it cannot get the parameter passed to it. However I see no reason why it is doing that considering the query is running ok.
Here is the code from the view method:
<body>
<h1>Hello <?=$fname?></h1>
<p>Hello World</p>
And the code from the controller:
function index(){
$this->load->model('User_Model','user');
$this->view->assign('title','Manage your Peacock account');
$this->view->assign('fname', $this->user->fname());
$this->view->display('user_view');
}
Finally the code from the model:
public function __get($property) {
if (property_exists($this, $property)) {
/**
* Retrieve the data from the database
*/
$this->$property = $this->db->query_one('select '.$this->getTable($property).' from users where id=?',array('1'));
return $this->$property;
}
}
Any help will be appreciated
tinymvc\sysfiles\plugins\tinymvc_view.php
and work backwards from there, preferably using a debugger – Phil 1 hour ago