Created
December 27, 2016 06:55
-
-
Save geff21st/efd576222b2ffd7ab07dfed9e1353307 to your computer and use it in GitHub Desktop.
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
<snippet> | |
<content><![CDATA[ | |
if(!Bitrix\Main\Loader::includeModule("iblock"))return; | |
\$arItems = array(); | |
\$arOrder = array(${1:"sort" => "asc"${2:, "date_active_from" => "desc"}}); | |
\$arFilter = array( | |
${4:"ACTIVE" => "Y", "ACTIVE_DATE" => "Y", | |
"IBLOCK_ID" => ${3:SOME}_IBLOCK,}${5} | |
); | |
\$arSelect = array("ID", "IBLOCK_ID", "NAME"${6}); | |
\$res = CIblockElement::GetList(\$arOrder, \$arFilter, false, ${8:array("nTopCount"=>${7:20})}, \$arSelect); | |
while (\$item = \$res->GetNext()) { | |
\$arItems[] = \$item;${0} | |
} | |
//d(\$arItems); | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>getlist</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<scope>source.php</scope> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment