Skip to content

Instantly share code, notes, and snippets.

@CB9TOIIIA
Created November 1, 2018 20:18
Show Gist options
  • Save CB9TOIIIA/22e6473b4cad5283c562051d94e62863 to your computer and use it in GitHub Desktop.
Save CB9TOIIIA/22e6473b4cad5283c562051d94e62863 to your computer and use it in GitHub Desktop.
Joomla API
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$template = $app->getTemplate();
$option = $app->input->getCmd('option', '');
$view = $app->input->getCmd('view', '');
$layout = $app->input->getCmd('layout', '');
$task = $app->input->getCmd('task', '');
$itemid = $app->input->getCmd('Itemid', '');
$menu = $app->getMenu();
$langCode = substr($doc->language, 0, 2);
$baseURL = JURI::base();
$baseURLlang = $baseURL . $langCode;
$sitename = $app->get('sitename');
<body class="site <?php echo $option
. ' view-' . $view
. ($layout ? ' layout-' . $layout : ' no-layout')
. ($task ? ' task-' . $task : ' no-task')
. ($itemid ? ' itemid-' . $itemid : '');
?>">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment