view
public function view( $edit = false, \Bitrix\Landing\Landing $landing = null, $params )
Directly displays block in browser with service tags and scripts depending on operation mode. Applied inside the method view for page object.
Parameters
Parameter | Description | Version |
---|---|---|
edit | Edit mode (true / false). | |
landing | Landing page object, containing block. | |
params | Array of additional parameters containing the following keys: wrapper_show – wrap the block by service div (true / false). |
Example
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) { $block->view(true, $landing); } } } foreach ($landing->getError()->getErrors() as $error) { echo $error->getCode() . ': '; echo $error->getMessage(); echo "\n"; } }
© «Bitrix24», 2001-2024