get component parameters in Joomla


If you want to get component parameter in your code, you can use following methods. Generally i used below methods to get component parameters. First you need to import Joomla component helper class into view.html.php.

jimport('joomla.application.component.helper');
get current component parameters
$app = JFactory::getApplication();
$params = $app->getParams();
$param = $params->get('show_create_date');

get another component parameters
$content_params = & JComponentHelper::getParams( 'com_content' );
$show_date = $content_params->get( 'show_create_date' );

get any Joomla component parameters one line code
$show_date = JComponentHelper::getParams('com_content')->get('show_create_date');
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s