I am creating a component in Joomla for the first time, now i am having a hard time calling data from my model in to my view. I did this as follows:
//In my model
class InternetModelDefault extends JModel {
public function test(){
$this->test='test';
}
}
//In my view
class InternetViewInternet extends JView {
$model = $this->getModel();
$test = $model->test();
var_dump($test);
// Display the view
parent::display($tpl);
}
}
The output gives the following error:
Fatal error: Call to a member function test() on a non-object in /var/websites/www.infrait.nl/content/components/com_internet/views/internet/view.html.php on line 66
Where does it went wrong? Please some help..
Current mapstructure:
http://imgdump.nl/hosted/ad9e57de83060b3240f8fc6bba99237b.png
As i am new i can only share you this direct link.