
<?php
if ($viewDetails) {
    $content = $viewDetails->content;

    // Remove the leading and trailing paragraph tags and split the content into paragraphs
    $paragraphs = preg_split('/<\/p>\s*<p>/', trim($content, "<p></p>"));

    // Define an array to hold paragraphs dynamically
    $dynamicParagraphs = [];

    // Loop through the paragraphs array and assign dynamically
    foreach ($paragraphs as $index => $paragraph) {
        $dynamicParagraphs["paragraph" . ($index + 1)] = $paragraph;
    }
}
?>


<div class='container-fluid'>

    <div class='row'>
        <div class="col-xs-12 col-sm-12 col-md-6 col-xl-6 col-xxl-6 text_gaps">

        <div class="bg-img-title text-left justify-content-left pt-2 pb-4">
            <!-- <span class="text-black"><//?= $pageTitle ?></span> -->
            <div class="display-5 sm-title-text blue_color"><?= $menuDetails->name ?></div>
            <hr class="mb-2 d-inline-block hr-1"/>
        </div>

            <h2><?= $viewDetails->name?></h2>
            <!-- <hr class="mb-2 d-inline-block" style="width: 120px; z-index:9; padding:1px 0px; margin-top:-5px!important; background-color:#146394;"/> <br /> -->
            
             <!------- Name and Position -------->
             <div class='name_button'>
             <?= $dynamicParagraphs['paragraph1']?>
                    </div>

            <div class='' style="display:block">
            <p class="pe-5"><?= $dynamicParagraphs['paragraph2']?></p>
</div>

            
        </div>

        <div class="col-xs-12 col-sm-12 col-md-6 col-xl-6 col-xxl-6 gx-md-0">
        <div class="aspect-banner">
            <img src="<?= $this->Url->image(!empty($viewDetails->content_images) > 0 ? $viewDetails->content_images[0]->image_path : 'noimage.png') ?>"
            class="img-fluid" alt="<?= $viewDetails->title ?>">
        </div>
        </div>
       
    </div>

   

    <div class='row pt-4 pb-5 aliceblue'>
        <div class="col-xs-12 col-sm-12 col-md-12 col-xl-12 col-xxl-12 now text_gaps text-dark">
            <p><?= $dynamicParagraphs['paragraph3']?></p>
            <!-- <p></?= $dynamicParagraphs['paragraph4']?></p> -->
        </div>      
    </div>

  

</div>



    



