Yii Framework Forum: opening a link in new tab - Yii Framework Forum

Jump to content

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

opening a link in new tab Rate Topic: -----

#1 User is offline   smug 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 29-April 11

Posted 29 September 2011 - 08:05 AM

hi all,


i have reports in my application wherein if i click a link in my menu the report gets loaded in the same window but i want that to be loaded in a new tab.how is it possible?please help

thanks
smug
0

#2 User is offline   ngc.7000 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 07-September 11
  • Location:Trondheim, Norway

Posted 29 September 2011 - 08:10 AM

Check the target="_blank" in the a tag, like:

<a href="http://some.funny.place.com/some/path" target="_blank">Don't lick me</a>

0

#3 User is offline   Larry Jr. 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 13-March 13
  • Location:Tomohon

Posted 08 October 2013 - 08:23 PM

View Postngc.7000, on 29 September 2011 - 08:10 AM, said:

Check the target="_blank" in the a tag, like:

<a href="http://some.funny.place.com/some/path" target="_blank">Don't lick me</a>



I'm using bootstrap, how to make this link below to open in new tab?

<?php echo TbHtml::stackedTabs(array(
    array('label' => 'E-mail BTPN', 'url' => 'https://corpmail.btpn.com/owa/'),
)); ?>

JoenMarz
0

#4 User is offline   Arockia Johnson 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 94
  • Joined: 25-June 13

Posted 10 October 2013 - 06:40 AM

Hi,

You can add the array element 'htmlOptions' as follows,

<?php

	echo TbHtml::stackedTabs(array(
		array(
			'label' => 'E-Mail BTPN',
			'url' => 'https:://corpmail.btpn.com/owa/',
			'htmlOptions' => array('target' => '_blank'), //Add your html options here
			),
		),
	);
?>



Now It will work

Cheers !
Thanks & Regards,
S.A. Johnson
www.arojohnson.tk
0

#5 User is offline   Larry Jr. 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 13-March 13
  • Location:Tomohon

Posted 15 October 2013 - 09:32 PM

I've tried as follows, but still not opening in new tab:
<?php echo TbHtml::stackedTabs(array(
            array('label' => 'E-Dapem', 'url' => 'http://edapem/btpn/login/login.jsp',),
            array(
                'label' => 'E-mail BTPN',
                'url' => 'https://corpmail.btpn.com/owa/',
                'htmlOptions' => array('target' => '_blank'), // Added here
                ),
            array('label' => 'Revampp', 'url' => '#',),
            array('label' => 'LAPPS', 'url' => 'http://lapps/btpn/login/login.jsp',),
            array('label' => 'MIS Portal', 'url' => '#',),
        )); ?>

JoenMarz
0

#6 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 495
  • Joined: 08-October 12
  • Location:Austria

Posted 16 October 2013 - 03:03 AM

Hi,


Try this

<?php echo TbHtml::stackedTabs(array(
            array('label' => 'E-Dapem', 'url' => 'http://edapem/btpn/login/login.jsp',),
            array(
                'label' => 'E-mail BTPN',
                'url' => 'https://corpmail.btpn.com/owa/',
                'linkOptions' => array('target' => '_blank'), // Added here
                ),
            array('label' => 'Revampp', 'url' => '#',),
            array('label' => 'LAPPS', 'url' => 'http://lapps/btpn/login/login.jsp',),
            array('label' => 'MIS Portal', 'url' => '#',),
        )); ?>

Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
0

#7 User is offline   Larry Jr. 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 13-March 13
  • Location:Tomohon

Posted 16 October 2013 - 04:05 AM

Thanks chandran, the linkOptions is the answer! It worked.
JoenMarz
0

#8 User is offline   chandran 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 495
  • Joined: 08-October 12
  • Location:Austria

Posted 16 October 2013 - 04:07 AM

Hi,
Instead of htmloptions i have used linkoptions..thats it
Thanks
chandran nepolean

My own extension:
http://www.yiiframew...sion/ejqueryte/

My wiki
http://www.yiiframew...checkboxcolumn/

If it work dont hesitate to click +1 button
0

#9 User is offline   Oleg Andreev 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 19-November 13

Posted 19 November 2013 - 04:21 AM

For this to work in a widget CMenu, need use 'itemOptions' =)
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