Skip to content

Instantly share code, notes, and snippets.

@gartes
Last active July 13, 2018 11:38
Show Gist options
  • Save gartes/653a42616bc8c5a7b6614c18654bbe49 to your computer and use it in GitHub Desktop.
Save gartes/653a42616bc8c5a7b6614c18654bbe49 to your computer and use it in GitHub Desktop.
JFactory::getApplication()
# https://docs.joomla.org/Display_error_messages_and_notices
// Get a handle to the Joomla! application object
$app = JFactory::getApplication();
// Add a message to the message queue
# message | notice | warning | error
$app->enqueueMessage(JText::_( 'TEXT_MESS' ), 'error');
// Получить из стека массив сообщений
$MessageArray = JFactory::getApplication()->getMessageQueue() ;
// Установка поля для вывода системных сообщений
// <jdoc:include type="message" />
// https://www.samontheweb.co.uk/add-or-remove-items-in-joomla-breadcrumb-system/
jimport( 'joomla.application.pathway' );
$app = JFactory::getApplication();
$pathway = $app->getPathway();
$pathway->addItem(vmText::_('COM_VIRTUEMART_CART_OVERVIEW'), JRoute::_('index.php?option=com_virtuemart&view=cart', FALSE));
// Проверка на админ панель
$app = JFactory::getApplication();
if ($app->isSite()) echo 'Client is site';
if ($app->isAdmin()) echo 'Client is administrator';
/*
* Получить тело документа
* обычно в вобытии onAfterRender
*
*/
$Html = $app->getBody();
// установка html
$app->setBody( $Html );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment