Yii Framework Forum: whats the proper way of editing - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

whats the proper way of editing parts of a link Rate Topic: -----

#1 User is offline   bettor 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 752
  • Joined: 02-February 09

Posted 10 January 2010 - 09:00 AM

Hi all,

What is the proper way of formatting part of a link. Link designed as below:
<?php echo CHtml::link($model['first_name']." - ".$model['last_name'], 'controller/action') ?>


I would like to format first_name in one way and last_name in another way. So far I was able to see how to format the whole link value in the blog demo:
$link=CHtml::link(CHtml::encode($tag), array('post/index','tag'=>$tag));
			echo CHtml::tag('span', array(
				'class'=>'tag',
				'style'=>"font-size:{$weight}pt",
			), $link)."\n";


...but I was wondering what is the proper way of formatting only part of the link.

thanks,
b
0

#2 User is offline   Y!! 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 978
  • Joined: 18-June 09

Posted 10 January 2010 - 09:06 AM

You can add any html to the link text like this:

<?php echo CHtml::link($model['first_name']." - <b>".$model['last_name']."</b>", 'controller/action') ?>

0

#3 User is offline   bettor 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 752
  • Joined: 02-February 09

Posted 11 January 2010 - 04:26 AM

View PostY!!, on 10 January 2010 - 09:06 AM, said:

You can add any html to the link text like this:

<?php echo CHtml::link($model['first_name']." - <b>".$model['last_name']."</b>", 'controller/action') ?>




Thanks RESOLVED
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users