On Aug 16, 2011, at 03:41, Jiří Vávrů wrote:
> 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>
In what way did this not work?
It looks to me like a syntax error. You have two opening parentheses but three
closing ones.
Also, why not simplify and take the bold tags out of the link function call
(line breaks added for readability):
<?php $title1 = $results[0]['news']['subject'];?>
<td colspan="2" class="subject"><b><?php
echo $this->Html->link(
$title1,
array('action' => 'viewNews', $results[0]['news']['id'])
);
?></b></td>
Or even better remove the bold tags entirely:
<?php $title1 = $results[0]['news']['subject'];?>
<td colspan="2" class="subject"><?php
echo $this->Html->link(
$title1,
array('action' => 'viewNews', $results[0]['news']['id'])
);
?></td>
and then style .subject to be bold in your css file.
--
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