Change the number of rows and columns in CakePhp view

0

In my company I had the requirement to decrease the number of columns to 3 and not show 5 rows but 16, the thing is that I do not understand how they are telling the code to only show that number of rows and columns, Here it happened to you as it looks now:

And the code is as follows:

<div id="used_list"><!-- the total columns U most SUM 12 -->


    <?php
        foreach ($UseCar as $car) {
            echo "<section>";
            echo "<h3>".substr($car['UseCar']['title'], 0, 23)."</h3>";
            if(!empty($car['UseImage'])){
                echo $this->Html->image('uploads/'.$car['UseImage'][0]['id'].'/'.$car['UseImage'][0]['image'], array('alt' => $car['UseCar']['title'], 'title' => $car['UseImage'][0]['title']));
            }else{
                $noImage = 'no_pic_available.jpg';
                if ($car['UseCar']['state'] == 'Por entrar') {
                    $noImage = 'no_pic_available_next.jpg';
                }
                echo $this->Html->image($noImage, array('alt' => 'Sin Imágen', 'title' => 'Imágen no disponible'));
            }
            if($car['UseCar']['promo_week']){
                echo $this->Html->image('promo_week.png', 
                    array('alt' => 'Oferta de la semana', 'class' => 'used_promo_banner'));
            }else if($car['UseCar']['promo_day']){
                echo $this->Html->image('promo_today.
                    png', array('alt' => 'Solo por Hoy', 'class' => 'used_promo_banner'));
            }
            echo "<p class='price'>".$this->Number->currency($car['UseCar']['price'], '$ ', 
                    array('thousands' => '.', 'places' => '0'))."</p>";
            echo "<p>".$car['UseCar']['year']."<span> | </span>".$car['UseCar']['kilometre']."Km</p>";


            $onclick = $this->Js->request(
                  array('controller' => 'used', 'action' => 'infoAjax', 
                     $car['UseCar']['id']), 
                  array('async' => true, 'update' => '#blackbox_content'));

            echo $this->Html->link('', array('action' => 'index', 'id' => $car['UseCar']['id']), 
              array('onclick' => 'display_blackbox(); '.$onclick, 'class' => 'use_link', 'title' => $car['UseCar']['title']));

            echo "</section>";
        }               
    ?>
</div>

That's the code that goes through the whole BD, but as I mentioned before, I do not know where they tell you to just put 5 rows and 4 columns. The boss mentioned that this was done by ajax by the previous developer but I do not see where they call an ajax in that code.

    
asked by Andrés Vélez 09.07.2018 в 17:24
source

0 answers