Last active
July 13, 2018 11:38
-
-
Save gartes/653a42616bc8c5a7b6614c18654bbe49 to your computer and use it in GitHub Desktop.
JFactory::getApplication()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Проверка на админ панель | |
$app = JFactory::getApplication(); | |
if ($app->isSite()) echo 'Client is site'; | |
if ($app->isAdmin()) echo 'Client is administrator'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Получить тело документа | |
* обычно в вобытии 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