Latest articles
Latest articles of category




Core Variables


During CMS installation, we have the settings.php file containing the core variables in order to specify your personal settings.

- The variable $WEBSITE_ROOT or $root holds the information of your website root.

Example Smarty Code
 
{$smarty.const.WEBSITE_ROOT}

Example PHP Code
 
echo $root

Returned Variables
 
www.guru-host.eu - The domain where we have made the installation of CMS

- The variable $THEME_ROOT holds the information of the path where the template files are.

Example Smarty Code
 
<link href="{$smarty.const.THEME_ROOT}/{$themeName}/css/main.css" rel="stylesheet" type="text/css" />

<img src="{$smarty.const.THEME_ROOT}/{$themeName}/images/logo.gif" alt="" border="0" />

Returned Variables
 
www.guru-host.eu/templates/themes - Based on the domain where we have made the installation of CMS

- The variable $site_name holds the information of our site's name.

Example PHP code
 
echo $site_name

Returned Variables
 
Guru-host site - Based on the domain where we have made the installation of CMS

- The variables $smtp_server, $smtp_port, $swiftmailer_username, $swiftmailer_password holds the necessary information for using swiftmailer with smtp authentication

Example PHP Code
 
require_once "../includes/swift4/lib/swift_required.php";
$transport = Swift_SmtpTransport::newInstance($smtp_server, $smtp_port)
  ->setUsername($swiftmailer_username)
  ->setPassword($swiftmailer_password);

Return Variables
 
Create a Swift instance, connect successfully with smtp authnetication and send the email as the sender we have set

Posted on: 23/03/2011