I'm writting a plugin for Joomla (first time working with Joomla) and I'm having a bit of trouble with something.
Basically what I need is a function in the plugin that returns an url that depends on the plugin parameters. I want to be able to call this function from the site's code like this:
<a href="<?php echo plgSystemMyplugin::get_home_url(); ">access</a>
and my function looks like this:
public function get_home_url () {
$dn = $this->params->getValue('domainname');
return 'https://'.$dn.'.mydomain.com';
}
but it returns:
https://.mydomain.com
Any help is appreciated, Thanks in advance
EDIT:
Was able to get around it (not sure if its the right way or not but at this point I just want to get it done).
public function get_home_url () {
$plg = JPluginHelper::getPlugin('system', 'myplugin');
$plg_params = new JRegistry();
$plg_params->loadString($plg->params);
$dn = $plg_params->get('domainname');
return 'https://'.$dn.'.mydomain.com';
}
var_dump($this->params)
and figure out why it's not pulling your domain name through is all I can suggest - basic debugging. - Jimbo