By LAC Webadmin on Friday, 12 June 2015
Replies 2
Likes 0
Views 845
Votes 0
Hi,

Is there a way to access Apps object from within the Apps Model?

Thanks,

Jackson
I got it

For those who need it:


// load apps library
$apps = FD::getInstance('Apps');

// get giving app data
$appTable = FD::table('App');
$appTable->load(array('element' => 'giving', 'group' => 'user'));

/**
* Note: element and group is a column in the #__social_apps table
* The values are defined in the app xml file
*/

// get giving app object
$app = $apps->getApp( $appTable );

// get giving app parameters
$this->params = $app->getParams();


I wish there is a shorter version of getting the app object or maybe there is one (please let me know). If only $this->app is visible in the App Model class.

Thanks,

Jackson
·
Friday, 12 June 2015 06:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Jackson,

Looks good for me. Glad you have found it.
·
Friday, 12 June 2015 10:40
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post