This file contains 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 | |
use Bitrix\Main\Application; | |
$request = Application::getInstance()->getContext()->getRequest(); | |
$value = $request->get("some_name"); | |
$value = $request["some_name"]; | |
$value = $request->getQuery("some_name"); // получение GET-параметра | |
$value = $request->getPost("some_name"); // получение POST-параметра | |
$value = $request->getFile("some_name"); // получение загруженного файла |
This file contains 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 | |
$aPropList = array(); | |
$rEnum = CIBlockProperty::GetPropertyEnum($propID, Array('SORT'=>'ASC'), Array("IBLOCK_ID"=>2)); | |
while($aEnum = $rEnum->Fetch()){ | |
$aPropList[] = array('id'=>$aEnum['ID'], 'code'=>$aEnum['XML_ID'] ,'value'=>$aEnum['VALUE']); | |
} |
This file contains 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 | |
$aFilter = Array('IBLOCK_ID'=>9, 'DEPTH_LEVEL'=>1,"UF_SECTION_REF" => $sectionID); | |
$rSect = CIBlockSection::GetList(Array('SORT'=>'ASC'), $aFilter, false, array('UF_*')); | |
$aSections = array(); | |
while($aSect = $rSect->GetNext()) { | |
$aSections[] = $aSect; | |
} |
This file contains 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 | |
use Bitrix\Main\Loader; | |
if(!Loader::includeModule("iblock")) die(); | |
$aFilter = array("IBLOCK_ID"=>25, "ACTIVE"=>"Y"); | |
$rPart = CIBlockElement::GetList(array('sort'=>'ASC'), $aFilter, false, false, array()); | |
while($oPart = $rPart->GetNextElement()): | |
$aPart = $oPart->GetFields(); | |
$aPart['PROP'] = $oPart->GetProperties(); |
This file contains 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 | |
if(!CModule::IncludeModule('highloadblock')) die(); | |
use Bitrix\Highloadblock as HL; | |
use Bitrix\Main\Entity; | |
$hlblock = HL\HighloadBlockTable::getById(5)->fetch(); | |
$hlEntity = HL\HighloadBlockTable::compileEntity($hlblock); | |
$entDataClass = $hlEntity->getDataClass(); |
This file contains 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 | |
function formatBytes($bytes, $precision = 2) | |
{ | |
$base = log($bytes, 1024); | |
$suffixes = array('', 'Кбайт', 'Мбайт', 'Гбайт', 'Тбайт'); | |
return round(pow(1024, $base - floor($base)), $precision) .' '. $suffixes[floor($base)]; | |
} | |
if(is_numeric($aProps['cr_pdf']['VALUE'])){ |
NewerOlder