Yii Framework Forum: CMenu, injecting HTML content after anchor. - Yii Framework Forum

Jump to content

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

CMenu, injecting HTML content after anchor. Rate Topic: -----

#1 User is offline   x3rx3s 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 31-October 10

Posted 30 December 2010 - 02:57 PM

Hi,

I'm using zii.widgets.CMenu, I'm trying to insert extra content after the anchor tag
example: <li><a href="x.html">Support</a><mytag></mytag></li>

Where <mytag> is my custom HTML content.

Thanks!
0

#2 User is offline   x3rx3s 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 31-October 10

Posted 30 December 2010 - 03:08 PM

Thanks onre,

For those interested, solution is:

 <?php
 $this->widget('zii.widgets.CMenu',array(
      'itemTemplate'=>'{menu}<span></span>',
      'items'=>array()
)
?>

0

#3 User is offline   Neeraj Kumar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 09-June 12

Posted 07 December 2012 - 03:11 PM

Hello Newbie

I need help

I want to and output like this
<a href="abc.php"><img src="abc.jpg" /></a>

I tried like this

$login = Yii::app()->request->baseUrl."/css/images/site/login.png";
$this->widget('zii.widgets.CMenu', array(
'items' => array(
array('label' => "<img src='$login' alt=''>",
'itemOptions' => array('class' => 'hdr_link'),
'url' => array('/user/login'), 'visible' => Yii::app()->user->isGuest),
),
));

but it dont gives me correct output

Please help me out.

Thanks in Advance.
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