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
$basePath = VMPATH_MY_PLUGIN_GLAVPUNKT . DS . 'layouts' ; | |
$data = array('name' => 'Dmitry'); | |
$layout = new JLayoutFile('glavpunkt.sspb', $basePath); | |
$html = $layout->render($data); // $displayData |
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
$language = JFactory::getLanguage(); | |
$language->load('lib_ukcpu' , UKCPU_LANGUAGE_PATH , $language->getTag(), true); | |
// Загрузака яыка для плагина | |
$lang = JFactory::getLanguage(); | |
$extension = 'plg_vmextended_account_ext'; | |
$base_dir = JPATH_PLUGINS . DS . 'plg_vmextended_account_ext' ; | |
$language_tag = $lang->getTag() ; | |
$reload = true; |
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
JPATH_ADMINISTRATOR // Путь к каталогу администратора (/administrator) | |
JPATH_BASE // Путь к установленному сайту Joomla | |
JPATH_CACHE // Путь к каталогу, содержащему кэш | |
JPATH_COMPONENT // Путь к компоненту, который в данный момент исполняется | |
JPATH_COMPONENT_ADMINISTRATOR // Путь к административному каталогу компонента, который исполняется | |
JPATH_COMPONENT_SITE // Путь к каталогу сайта того компонента, который исполняется | |
JPATH_CONFIGURATION // Путь к каталогу, содержащему файл конфигурации configuration.php | |
JPATH_INSTALLATION // Путь к каталогу установки Joomla | |
JPATH_LIBRARIES // Путь к каталогу, содержащему библиотеки Joomla | |
JPATH_PLUGINS // Путь к каталогу, содержащему плагины Joomla |
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
$jinput = JFactory::getApplication()->input; | |
$id = $jinput->get('id', null, 'int'); // int(-123) INT, INTEGER – первое целое число | |
$text = $jinput->get('text' , null , 'BOOL' ); // bool(true) | |
$text = $jinput->get('text' , null , 'WORD' ); // string(35) "AaBb_metacontentJoomlanamegenerator" | |
$phone = $jinput->get('phone_1' , null , 'BASE64' ); // string(42) "123AaBb=+metacontent=Joomlaname=generator/" | |
$phone = $jinput->get('phone_1' , null , 'STRING' ); // string(42) "string(43) "..-123 AaBb ДдГг = [] () + ^ * _ . % - "" | |
$text = $jinput->get('text' , null , 'RAW' ); // RAW – фильтрация не применяется. Доступен начиная с Joomla 3. | |
// Применяем тип фильтра "INT" |
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
try{ | |
throw new Exception( 'Error_Text' ); | |
}catch (Exception $e){ | |
JFactory::getApplication()->enqueueMessage( $e->getMessage() , 'error'); | |
} | |
// $e->getCode() | |
// $e->getMessage() |
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
ChromePhp::log('Hello console!'); | |
ChromePhp::log($_SERVER); | |
ChromePhp::warn('something went wrong!'); | |
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
<?php | |
echo "Файл с ошибками. Начало<br><br>"; | |
/* | |
* перехватываемые ошибки (ловятся функцией set_error_handler()) | |
*/ | |
// NONFATAL - E_NOTICE | |
// echo $undefined_var; | |
// NONFATAL - E_WARNING | |
// array_key_exists('key', NULL); | |
// NONFATAL - E_DEPRECATED |
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
jimport('ukcpu.user.libuser'); |
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
$productModel = VmModel::getModel('product'); |
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
JLog::addLogger( | |
array( | |
// Sets file name | |
'text_file' => 'com_helloworld.log.php' | |
), | |
// Sets messages of all log levels to be sent to the file | |
JLog::ALL, | |
// The log category/categories which should be recorded in this file | |
// In this case, it's just the one category from our extension, still | |
// we need to put it inside an array |