4use \Bitrix\Landing\Landing;
5use \Bitrix\Landing\Block;
17 $siteId = (int) $siteId;
18 $tplCode = (string) $tplCode;
26 '=TPL_CODE' => $tplCode
29 if ($row = $res->fetch())
31 $landingId = $row[
'ID'];
35 $res = \Bitrix\Landing\PublicAction\Landing::addByTemplate(
39 $landingId = $res->getResult();
51 protected static function prepareForm(array $manifest, array $params = [])
59 if (!isset($params[
'resultPage']))
65 $manifest[
'callbacks'] = array(
66 'afterAdd' =>
function (
Block &$block) use($params)
69 $landingId = Search::getSearchResultPage(
80 $attributeSelector =
'';
81 foreach ($manifest[
'attrs'] as $selector => $item)
84 $item[
'type'] ==
'url' &&
85 $item[
'attribute'] ==
'action'
88 $attributeSelector = $selector;
94 $attributeSelector => [
95 'action' =>
'#landing' . $landingId
114 if (!isset($params[
'type']))
119 if ($params[
'type'] ==
'form')
121 return self::prepareForm($manifest, $params);
save(array $additionalFields=[])
getManifest($extended=false, $missCache=false, array $params=array())
static getList(array $params=array())
static prepareForm(array $manifest, array $params=[])
static prepareManifest(array $manifest, Block $block=null, array $params=[])
static getSearchResultPage($siteId, $tplCode)