PHP code example of mvrk / icenberg

1. Go to this page and download the library: Download mvrk/icenberg library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mvrk / icenberg example snippets



$icenberg->the_element('client_logos');



$composer_path = $_SERVER['DOCUMENT_ROOT'] . '/../vendor/';

if (file_exists($composer_path)) {
    


\MVRK\Icenberg\Hooks::init();



$is_wp_cli = defined('WP_CLI') && WP_CLI;

if ($is_wp_cli) {
    \MVRK\Icenberg\Commands\Bootstrap::setup();
}



use MVRK\Icenberg\Icenberg;

$ice = new Icenberg($layout = 'block_name');



use MVRK\Icenberg\Icenberg;

$ice = new Icenberg(strtolower($block['title']));
$wrapped = true;

$ic->wrap(
    [
        $ice->get_element('quote'),
        $ice->get_element('attribution'),
        $ice->get_element('portrait_image'),
    ],
    $block,
    $wrapped
);



if (have_rows('content_blocks', $id)) :

    while (have_rows('content_blocks', $id)) : the_row();

        get_template_part('inc/blocks/block_template');

    endwhile;

endif;



use MVRK\Icenberg\Icenberg;

$ice = new Icenberg(get_row_layout());

$ice->the_element('quote');
$ice->the_element('attribution');
$ice->the_element('portrait');



$ice = new Icenberg($layout = "testimonial", $prefix = "block", $post_id = false)



$field_name = $ice->get_element('field_name');

echo $field_name;



$ice->the_element('field_name');



$ice->the_element('field_name, options');



$ice->enclose('text', [
    $ice->get_element('cta_heading')
    $ice->get_element('cta_content'),
]);



$random_text = "<span>I am some random text, isn't it wonderful?</span>";

$ice->enclose('text', [
    $ice->get_element('cta_heading'),
    $random_text
]);



$lady_in_red = $ice->value('dancing_with_me');



 $ice->field($field_name)

 


$ice->field('saxophone')->get()



$group = $ice->field('bad_singers')->prune(['chris_de_burgh', 'cliff_richard'])->get();



$group = $ice->field('great_singers')->only(['chris_de_burgh'])->get('marquee');



if ($ice->field('font_colour')->is('red')) :
    $ice->the_element('font_colour');
else :
    echo 'oh no';
endif;


if ($ice->field('mall')->has('cop')) :
    echo 'blart';
endif;

if ($ice->field('range_test')->lessThan(51)) :
    $class = 'text_' . $ice->field('range_test')->field;
    $ice->enclose($class, [
        $ice->get_element('cta_content'),
        $ice->get_element('cta_image'),
    ]);
endif;

$classes = ['banana', 'orange'];

$block_settings = get_sub_field($block_settings);

$settings = $ice->settings($block_settings, $classes);

$ice->enclose ($settings, [
    $ice->get_element('cheese_board'),
    $ice->get_element('flame_thrower')
])

$ice->wrap(
    [
        $ice->get_element('quote'),
        $ice->get_element('attribution'),
    ],
    $block,
    $wrap_inner = true,
    $background = $ice->get_element('background_image')
);

use MVRK\Icenberg\Icenberg;
use MVRK\Icenberg\Blocks\InnerBlocks;

$icenberg = new Icenberg('my_block');
$allowed_blocks = ['core/heading', 'core/paragraph'];

$content = $icenberg->get_enclose('content', [
    $icenberg->get_element('intro'),
    InnerBlocks::make($allowed_blocks, $icenberg),
]);

$icenberg->wrap([$content], $block);

$accent = $ice->member('accent_colour', 'block_settings');

function acf_google_map_field($api)
{
    $api['key'] = GOOGLE_MAPS_API_KEY;

    return $api;
}
add_filter('acf/fields/google_map/api', 'acf_google_map_field');
html

<div class="testimonial__corner-illustration_green_reversed">
     if($motif_variation_5_purple === 'orange') :
    $ice->the_element('motif_blurple');
    endif; 
html

<div  echo $settings;