Last active
February 7, 2023 06:45
-
-
Save Mahno74/8ecaf7c30522e5a0d24be0c73f7c822e to your computer and use it in GitHub Desktop.
Коды для Bitrix
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
//Заголовок станицы | |
<? $APPLICATION->SetPageProperty('title', 'Какой-то заголовок (новый)'); ?> | |
//Вывод массива | |
<? | |
//удобный вывод дампа в php.ini | |
function sl_dump($var, $all = false, $die = false) | |
{ | |
global $USER; | |
if(($USER->isAdmin() == 1) || ($all == true)) | |
{ | |
$bt = debug_backtrace(); | |
$bt = $bt[0]; | |
$dRoot = $_SERVER["DOCUMENT_ROOT"]; | |
$dRoot = str_replace("/","\\",$dRoot); | |
$bt["file"] = str_replace($dRoot,"",$bt["file"]); | |
$dRoot = str_replace("\\","/",$dRoot); | |
$bt["file"] = str_replace($dRoot,"",$bt["file"]); | |
?> | |
<div style='font-size:9pt; color:#000; background:#fff; border:1px dashed #000;'> | |
<div style='padding:3px 5px; background:#99CCFF; font-weight:bold;'>File: <?=$bt["file"]?> [<?=$bt["line"]?>]</div> | |
<pre style='overflow-x: auto; white-space: pre-wrap; white-space: -moz-pre-wrap !important; white-space: -pre-wrap; | |
white-space: -o-pre-wrap; word-wrap: break-word; background: #fff;'><?print_r($var)?></pre> | |
</div> | |
<? | |
} | |
if($die) | |
{ | |
die; | |
} | |
} | |
?> | |
//в коде | |
<?echo sl_dump($arItem)?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment