If your link text includes HTML then you need to change your call
from :
<?php echo $this->Html->link(__("<b>"."$title1"."</b>"),
array('action' => 'viewNews',$results[0]['news']['id']));?>
to:
<?php echo $this->Html->link(__("<b>"."$title1"."</b>"),
array('action' => 'viewNews',$results[0]['news']['id']),
array('escape'=>false));?>
Personally, I would add a class and style the link with CSS rather
than add <b> tags to the link text.
HTH, Paul.
On Aug 16, 9:45 am, ozgeek <[email protected]> wrote:
> Try :
> <?php echo $this->Html->link(__("<b>"."$title1"."</b>"),
> array('action' => 'viewNews',$results[0]['news']['id']));?>
>
> On Aug 16, 9:41 am, Jiří Vávrů <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hello,
> > I need to insert dynamicaly text into link.
> > I tried this solution, but is not working.
>
> > What I do wrong?
>
> > <?php $title1 = $results[0]['news']['subject'];?>
> > <td colspan="2" class="subject"><?php echo
> > $this->Html->link("<b>"."$title1"."</b>"), array('action' =>
> > 'viewNews',$results[0]
>
> > ['news']['id']));?></td>
>
> > Thanks for any advice
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php