2016-06-29 16 views
0

Ich habe versucht, die Tabelle Felder nacheinander zu echo. Aber ich kann das Bildfeld nicht wiedergeben. Mein Code ist:Bild lädt nicht mit Php echo

if ($data->Prophylaxis_Indicated == 1) { 
    echo "<td><span title='true_logo'> <img src='url('images/1-icon.png')' height='20' width='20'></span></td>"; 
} else { 
    echo "<td> <span title='true_logo'><img src='url('images/0-icon.png')'height='20' width='20'></span></td>"; 
} 

Antwort

0

Ich denke, das Problem ist, dass Sie versuchen, Blade-Syntax in der Steuerung zu verwenden.

Verwendung dieser Code dies funktionieren wird

if(($data->Prophylaxis_Indicated)==1){ 
       echo " <td><span title='true_logo'> 
       <img src='images/1-icon.png' 
       height='20' width='20'> 
       </span></td>"; 

       } 
       else{ 

       echo "<td> <span title='true_logo'> 
       <img src='images/0-icon.png' 
       height='20' width='20'> 
       </span></td>"; 
      } 
+0

dank dies funktioniert –

+0

Ich würde vorschlagen, dass es auf diese Weise tun: ' "Vermögenswert ('images/1-icon.png')."' '..src = height = '20' width =‘ 20 '/> ... ' –

0

Verwendung Doppelstrich so kann es nicht cz Syntax Fehler

src="url('images/0-icon.png')" 

statt

src='url('images/0-icon.png')' 
1

dies funktioniert für mich

if(($data->Prophylaxis_Indicated)==1){ 
       echo " 
       <td> 
       <span title='true_logo'> 

       <img src='/../images/1-icon.png' height='20' width='20'> 
       </span> 
       </td>"; 

       } 
       else{ 

       echo "<td> <span title='true_logo'> 
       <img src='/../images/0-icon.png' height='20' width='20'> 


       </span></td>"; 
      } 
+0

danke .. aber ich habe die Antwort schon bekommen. –