This is my function:
Located in "Media/com_easysocial/apps/user/evepos/models/apierror.php"
public function getItems( $userId ) {
$string = "https://api.eveonline.com/eve/ErrorList.xml.aspx";
$xml = simplexml_load_file($string);
foreach ($xml->result->rowset as $row) {
$count = $row->count();
};
$i = "0";
$arraynode ="1";
do {
$errorcode = "error_".$xml->result->rowset->row[0+$i]['errorCode'];
$this->set( $errorcode , $xml->result->rowset->row[0+$i]['errorText']);
$count = $count-1;
$arraynode = $arraynode+1;
$i = $i+1;
}
while ($count > 0);
}
}
in "Media/com_easysocial/apps/user/evepos/views/evepos.php"
Iv coded in
public function display( $userId )
{
$model = $this->getModel( 'apierrors' );
$result = $model->getitems( $userId );
echo $this->error_101;
}
This will put out an error message
Notice: Undefined property: EvePosViewCanvas::$error_101
What the function in the model does, is that it collects data from an api and put them into
$this->error_100
$this->error101
$this->error102
and so on
What I want here, is to be able to echo $this->error101 in this case in canavas/view.html.php.
So what do i need to do in order to be able to use these values in views as well as in the application themes?
Do i have to write the foreach statement inside view.html.php ? or can i import the values from the module to views and themes somehow?