Documentation

export

public static function export(
);

Exports block contents (nodes, styles, attributes). Returns an array

return [
   'cards' => [],//detail forms/cards
   'nodes' => [],//nodes
   'style' => [],//styles
   'attrs' => []//attributes
];

Parameters

No parameters

Examples

if (\Bitrix\Main\Loader::includeModule('landing'))
{
   \Bitrix\Landing\Landing::setEditMode(true);

   $landing = \Bitrix\Landing\Landing::createInstance(
      1
   );
   if ($landing->exist())
   {
      foreach ($landing->getBlocks() as $block)
      {
         if ($block->getId() == 45013)
         {
            var_dump($block->export());
         }
      }
   }


   foreach ($landing->getError()->getErrors() as $error)
   {
      echo $error->getCode() . ': ';
      echo $error->getMessage();
      echo "\n";
   }
}


© «Bitrix24», 2001-2024
Up