Parse error: syntax error, unexpected T_ECHO |
[eluser]Mainboard[/eluser]
i have a little problem with codeigniter, in the view when i try to call some variables i have this problem, this is my code. My View. Code: <? php foreach ($menu_enc as $menue): ?> Code: <? '<a class="current">destino;'>' echo $menue->nombre_enc; '</a>' ?> Code: <?php endforeach; ?> i try with add echo at the start on the phrase like this Code: <? echo '<a class="current">destino;'>' echo $menue->nombre_enc; '</a>'; ?> but not works, and i don't know why in the preview doesn't appear the href="'echo $menue->link; so i what i can do? i know that is a some problem with the syntax but i can't find the correct syntax
[eluser]jmadsen[/eluser]
Thank you for moving your question over here. CodeIgniter syntax is php syntax; you need to do things in the same way. Code: <?php '<a class="current">destino;'>' echo $menue->nombre_enc; '</a>' ?> should read: Code: <?php echo '<a class="current">' . $menue->nombre_enc . '</a>'; ?> I don't understand "destino" - is this the href="" part, and does it come from your database? Grrr..the forum is making a mess of the html code!! If $menue->destino is your href, then use: Code: href=" " Code: '.$menue->destino.' ---- Here are some more resources for understanding "concatenation": An easy to read tutorial: http://phphowto.blogspot.com/2006/12/con...rings.html The manual: http://php.net/manual/en/language.operators.string.php
[eluser]Anonymous[/eluser]
This should work Code: <?php |
Welcome Guest, Not a member yet? Register Sign In |