div does not appear with cakePHP 3.6

0

Hello, I have a layout and within this position content through fetch ('content')? >

The views in cakePHP 3.6 are saved in src / template - > Vista / vista.ctp

Well, I have a view that is a very simple code, it does a foreach and I show the result in a div.

Well, everything works but the div is obvious, I'm going crazy, because I do not know why it does not show it, I put the code of the view:

<?php foreach($textos as $texto): ?>
  <?= $texto->texto; ?>
<?php endforeach; ?>

<?php $historia = $texto[0]['texto']; ?>

<div id='historia'>
    <?= $historia; ?>
</div>  

and of course, the div id is associated with some styles and when they do not appear, they are not loaded. Poor to put inside the PHP code, showing with echo, but it did not work either.

    
asked by Isaac Palacio 26.06.2018 в 17:54
source

1 answer

1

I already found the problem:

<div id="historia">
  <?php foreach($textos as $texto): ?>
    <?= $texto->texto; ?>
  <?php endforeach; ?>
</div>

It seems that if it showed the div, but I showed it at the end and emptied it, but in this way it shows it without problem.

Greetings

    
answered by 26.06.2018 в 18:10