![]() |
anchor target - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: anchor target (/showthread.php?tid=44138) |
anchor target - El Forum - 08-04-2011 [eluser]Mainboard[/eluser] hey, i want to know how i can to add the target in the anchor function, i have this Code: $html_out .= "\t\t\t".'<li>'.'<a name='.$title.' id='.$id.' target='.$target.'><span>'.$title.'<span></a>'; and i want to add the attribute target in this line Code: $html_out .= "\t\t\t".'<li>'.anchor($url.' '. $this->class_parent, '<span>'.$title.'</span>'); a read the function and i know that i need to add the attributes at the end, but doesn't work, i think that is problem for the sintax that i have anchor target - El Forum - 08-04-2011 [eluser]rwestergren[/eluser] Attributes should be passed as the third parameter. Code: $html_out .= "\t\t\t".'<li>'.anchor($url.' '. $this->class_parent, '<span>'.$title.'</span>', 'target=\"_blank\"'); anchor target - El Forum - 08-04-2011 [eluser]Mainboard[/eluser] thanks, but, i put to this way because $target is variable that i caching in my db Code: $html_out .= "\t\t\t".'<li>'.anchor($url, '<span>'.$title.'</span>', $target); anchor target - El Forum - 08-05-2011 [eluser]Aken[/eluser] Code: $html_out = "\t\t\t".'<li>'.anchor($url.' '. $this->class_parent, '<span>'.$title.'</span>', 'name="'.$title.'" id="'.$id.'" target="'.$target.'"'); |