Wrapping lines in a date attribute when displaying on the front end

0

Within a table I have the following structure:

<td>
<a href="#" data-toggle="popover" title="Dados" data-trigger="focus"
data-content=" <?php 
echo $BlobParams[0].'<br>';
echo $BlobParams[1].'<br>';
echo $BlobParams[2].'<br>';
echo $BlobParams[3].'<br>';
echo $BlobParams[4].'<br>';
echo $BlobParams[5].'<br>';
echo $BlobParams[6];
?>">
Parametros
</a>
</td>

As% of data appears in an array , I would like one item to appear below the other. I tried to use data-content in several ways, but it did not work. <br> appears on the screen.

    
asked by anonymous 17.12.2018 / 14:46

3 answers

1

At the level of curiosity and I do not know if it is the best way, I was able to solve the case as follows in the function call:

$('[data-toggle="popover"]').popover({html: true})

I've added html: true. With this I was able to use the normal one.

    
19.12.2018 / 12:08
0

PHP_EOL is ostensibly used to find the newline character in a cross-platform way. PHP_EOL represents the end character for the current system, different from an html tag as the <br> tag.

Predefined constant PHP_EOL (string) - 'End Of Line'. Available since PHP 5.0.2, according to the PHP manual.

Use in your case:

<td>
    <a href="#" data-toggle="popover" title="Dados" data-trigger="focus"
            data-content="<?php echo PHP_EOL .
                            $BlobParams[0]. PHP_EOL .
                            $BlobParams[1]. PHP_EOL .
                            $BlobParams[3]. PHP_EOL .
                            $BlobParams[2]. PHP_EOL .
                            $BlobParams[4]. PHP_EOL .
                            $BlobParams[5]. PHP_EOL .
                            $BlobParams[6]; ?>"> Parametros</a> 
</td>
    
17.12.2018 / 15:35
0

A new alternative to writing data. If the person does not use any filter parameter, it will not appear and there will not be a blank line

<?php
foreach($BlobParams as $blobs){
if($blobs != ""){
echo "- ".$blobs."<br>";
}
}
?>
    
19.12.2018 / 13:43