简体   繁体   中英

How to output 'Site Name' in Joomla 3.x with PHP?

I've created a custom template for Joomla 3, but want to be able to dynamically output (or otherwise work with) the 'Site Name' - as defined in the Joomla administrative interface: SYSTEM > GLOBAL CONFIGURATION > SITE > SITE NAME .

I've accomplished something similar using JFactory / JInput in order to get the ItemID of the current page, but can't seem to determine the corresponding syntax for the Site Name.

This is the code used in order to pull ItemID, for what little it's worth;

$jinput = JFactory::getApplication()->input;
$Itemid = $jinput->get('Itemid');

Thanks in advance for any help anyone can provide.

You can get all global config using,

$config = JFactory::getConfig();
echo 'Site name is ' . $config->get( 'sitename' );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM