Documentation

copy

public function copy(
   $toSiteId, 
   $toFolderId
);

Method for copying a landing page. Returns ID for new page.

Parameters

Parameter Description Available from version
$toSiteId ID for site to copy the page. Optional, by default, current page site.
$toFolderId Folder ID to copy the page. Optional, by default either current folder or site root.

Example

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

   $landing = \Bitrix\Landing\Landing::createInstance(
      1
   );
   if ($landing->exist())
   {
      var_dump($landing->copy());
   }
   
   foreach ($landing->getError()->getErrors() as $error)
   {
      echo $error->getCode() . ': ';
      echo $error->getMessage();
      echo "\n";
   }
}


© «Bitrix24», 2001-2024
Up