Yii Framework Forum: Putting Logo Inside Tbnavbar - Yii Framework Forum

Jump to content

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

Putting Logo Inside Tbnavbar Rate Topic: -----

#1 User is offline   Trinh Duy Hung 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 26-October 12

Posted 12 April 2013 - 10:40 PM

Hi there!

I'm trying to put my logo into the TbNavBar so I put this code
$this->widget('bootstrap.widgets.TbNavbar', array(                       
      'brand' => '<img src =" <?php echo Yii::app()->request->baseUrl; ?>/images/logo.jpg" />',
      ...

But the image doesn't appear as expected.
Attached File  Capture.PNG (2.43K)
Number of downloads: 22

Any suggestion would be appreciated!

Cheers.
0

#2 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,082
  • Joined: 16-February 11
  • Location:Japan

Posted 13 April 2013 - 06:22 AM

Hi Trinh,

I think "echo" is causing the trouble. Try instead:
$this->widget('bootstrap.widgets.TbNavbar', array(                       
      'brand' => '<img src ="' . Yii::app()->request->baseUrl . '/images/logo.jpg" />',
      ...

0

#3 User is offline   sifa786 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 41
  • Joined: 12-February 13

Posted 20 April 2013 - 05:47 PM

thanks, this helped me!

View Postsoftark, on 13 April 2013 - 06:22 AM, said:

Hi Trinh,

I think "echo" is causing the trouble. Try instead:
$this->widget('bootstrap.widgets.TbNavbar', array(                       
      'brand' => '<img src ="' . Yii::app()->request->baseUrl . '/images/logo.jpg" />',
      ...


0

#4 User is offline   andy_s 

  • Random Member Title
  • Yii
  • Group: Moderators
  • Posts: 1,526
  • Joined: 22-June 09
  • Location:Russia, Kostroma

Posted 20 April 2013 - 05:54 PM

Yii way :lol:

'brand'=>CHtml::image(Yii::app()->getBaseUrl().'/images/logo.jpg'),


Generates missing alt="" for free :)
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