By Jostein Rosenlund on Thursday, 12 December 2013
Posted in Technical Issues
Replies 3
Likes 0
Views 1.1K
Votes 0
$model 	= $this->getModel( 'apistring' );
$result = $model->getAPIstring( $userId );
$this->apistring = $result;


the code is located in view.html.php.

When i run

echo $this->apstring;
inside view.html.php i get no error, and the data is outputed.

But when i code in:

echo parent::display( 'canvas/default' );


in view.html.php

and

<? $this->apistring;?> or <? echo $this->apistring;?>


in /themes/default/canavas/default.php

I get the following error code.

Notice: Undefined property: SocialThemes::$apistring in /home/norcorp/public_html/media/com_easysocial/apps/user/textbook/themes/default/canvas/default.php on line 20

Looks to me like there are no data in $this-apistring.

What am i doing wrong?
That is the default way to set variables in Joomla but in EasySocial, you'll need to do something like this,


// In the view.html.php file
$variable = 'hello';
$this->set( 'hello' , $variable );
echo parent::display( 'canvas/default' );

// In the theme file
<?php echo $hello; ?>
·
Thursday, 12 December 2013 01:57
·
0 Likes
·
0 Votes
·
0 Comments
·
yea that worked, but i did not manage to place the data from a sql query in tables the way other applications do.
·
Thursday, 12 December 2013 02:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm, sorry but not too sure if I understand you here. Can you please elaborate more on this please?
·
Thursday, 12 December 2013 15:29
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post